-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
103 lines (83 loc) · 2.88 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/**
* Copyright (C) 2014 Perforce Software. All rights reserved.
*
* Please see LICENSE.txt in top-level folder of this distribution.
*/
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'java-library-distribution'
apply plugin: 'jacoco'
sourceCompatibility = 11
project.ext.ver = project.hasProperty('ver') ? project.ext.ver : '0'
version = project.ext.ver
repositories {
mavenCentral()
}
configurations {
provided
compile.extendsFrom provided
}
//From Gradle 7 onwards, it is required to rename compile, testCompile and configurations.runtime to implementation, testImplementation
// and configurations.runtimeClasspath respectively
dependencies {
implementation files( 'libs/api.jar', 'libs/util.jar' )
implementation 'com.perforce:p4java:2024.2.2695691'
implementation 'org.apache.logging.log4j:log4j-api:2.23.1'
implementation 'org.apache.logging.log4j:log4j-core:2.23.1'
implementation 'commons-io:commons-io:2.15.1'
implementation 'org.apache.commons:commons-exec:1.4.0'
implementation 'org.apache.commons:commons-compress:1.26.2'
testImplementation 'junit:junit:4.13.2'
}
jar {
//From Gradle 7 onwards, it is explicitly required to specify the duplicate strategy to avoid getting the error
//'Entry META-INF/DEPENDENCIES is a duplicate but no duplicate handling strategy has been set'
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest {
attributes( 'Bundle-Name': project.name,
'Mathworks-Bundle': 'true',
'Bundle-SymbolicName': 'com.perforce.p4simulink',
'Budle-Description': 'Perforce CM integration for Simulink',
'Budle-Vendor': 'Perforce Software',
'Bundle-Version': version,
'Specification-Title': project.name,
'Specification-Version': version,
'Bundle-Activator': 'com.mathworks.util.osgi.ServicesActivator',
'Services': 'com.mathworks.cmlink.api.version.r16b.CMAdapterFactory: com.perforce.p4simulink.P4AdapterFactory')
}
// include dependent jars (build a so-called "fat" jar)
dependsOn configurations.runtimeClasspath
from {
(configurations.runtimeClasspath - configurations.provided).collect {
it.isDirectory() ? it : zipTree(it)
}
} {
exclude "com/mathworks/**"
}
}
test {
include 'com/perforce/p4simulink/tests/**'
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
// set heap size for the test JVM(s)
minHeapSize = "128m"
maxHeapSize = "512m"
// set JVM arguments for the test JVM(s)
jvmArgs '-XX:MaxPermSize=256m'
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
}
jacoco {
toolVersion = "0.8.4"
reportsDir = file("$buildDir/jacoco")
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.enabled false
}
}