-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
136 lines (121 loc) · 4.96 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
apply plugin: 'java'
// For buildscript -> repositories -> maven
apply plugin: 'maven'
apply plugin: "org.sonarqube"
// Add automated release process
apply plugin: 'net.researchgate.release'
sourceCompatibility = 1.8
targetCompatibility = 1.8
// Configure the maven repository deployment
install {
repositories.mavenInstaller {
// Set the version
pom.version = version
// Set the group/namespace for the maven repository deployment.
pom.groupId = 'jsr223'
}
}
repositories {
if (project.hasProperty('local')) {
mavenLocal()
}
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven { url 'http://repository.activeeon.com/content/groups/proactive/'}
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url "http://repository.activeeon.com/content/groups/proactive/"
}
}
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1"
classpath 'net.researchgate:gradle-release:2.2.1'
// Code Formatting dependencies
classpath "com.diffplug.gradle.spotless:spotless:2.4.0"
classpath "org.ow2.proactive:coding-rules:1.0.0"
delete "gradle/ext"
ant.unjar src: configurations.classpath.find { it.name.startsWith("coding-rules") }, dest: 'gradle/ext'
// END code formatting dependencies
}
}
apply from: "$rootDir/gradle/ext/coding-format.gradle"
// Configure the release process plugin
release {
// Add tags to the commits generated by this plugin. That way it is clear that no human did
// those commits. That allows to not trigger automated builds with jenkins if those tags appear.
preTagCommitMessage = '[ci skip][Gradle Release Plugin] - pre tag commit: '
tagCommitMessage = '[ci skip][Gradle Release Plugin] - creating tag: '
newVersionCommitMessage = '[ci skip][Gradle Release Plugin] - new version commit: '
}
configurations {
provided
}
sourceSets {
main {
main.compileClasspath += configurations.provided
test.compileClasspath += configurations.provided
test.runtimeClasspath += configurations.provided
}
}
dependencies {
compile group: 'net.sf.py4j', name: 'py4j', version: '0.10.8.1'
compile 'org.projectlombok:lombok:1.16.6'
compile 'ch.qos.reload4j:reload4j:1.2.25'
compile 'com.google.guava:guava:32.0.1-jre'
provided 'org.ow2.proactive:scheduler-api:+'
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.1'
testCompile('junit:junit:4.12') {
exclude module: 'hamcrest'
exclude module: 'hamcrest-core'
}
testCompile 'org.mockito:mockito-all:1.10.19'
}
// Configure sonarqube plugin.
// Username and password need to be added through the command line. Add username with
// -Dsonar.jdbc.username=[username] and password with
// -Dsonar.jdbc.password=[password] to the './gradlew sonarqube' command.
// For sonarqube github access sonar.github.repository=ow2-proactive/connector-iaas
// is added. Following proerties need to be added
// from commandline to make github pull request reports working.
// -Dsonar.github.pullRequest=${ghprbPullId} The current pull request id. ${ghprbPullId} is a
// propagated jenkins variable, from the github pull request plugin.
// sonar.github.login=[github-username] github login to write comments
// sonar.github.oauth=[oauth-token] github oauth token to write comments on pull reqeust
// sonar.issuesReport.console.enable=true to have a report on the commandline (for jenkins)
// sonar.analysis.mode=preview the preview mode does not write the result into the database and only analyzes
// files modified in the current pull request.
sonarqube {
properties {
property "sonar.projectName", "jsr223-cpython"
property "sonar.host.url", "http://master.ci.activeeon.com:9000"
property "sonar.jdbc.url", "jdbc:postgresql://master.ci.activeeon.com:5432/sonar"
property "sonar.projectVersion", version
// For github plugin
property "sonar.github.repository", "ow2-proactive/scriptengine-docker-compose"
}
}
// Upload the archives to the nexus repository. For execution, that needs to have
// the username and password set in the command line by -DnexusUsername=[username]
// and -DnexusPassword=[password]
uploadArchives {
repositories {
mavenDeployer {
pom.groupId = 'jsr223'
snapshotRepository(url: "http://repository.activeeon.com/content/repositories/snapshots/") {
authentication(userName: "${System.getProperty('nexusUsername')}",
password: "${System.getProperty('nexusPassword')}")
}
repository(url: "http://repository.activeeon.com/content/repositories/releases/") {
authentication(userName: "${System.getProperty('nexusUsername')}",
password: "${System.getProperty('nexusPassword')}")
}
}
}
}