forked from ow2-proactive/scriptengine-docker-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
126 lines (112 loc) · 4.72 KB
/
build.gradle
File metadata and controls
126 lines (112 loc) · 4.72 KB
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
apply plugin: 'java'
// For buildscript -> repositories -> maven
apply plugin: 'maven'
apply plugin: 'application'
apply plugin: "org.sonarqube"
// Add automated release process
apply plugin: 'net.researchgate.release'
sourceCompatibility = 1.7
targetCompatibility = 1.7
// Load the version number. This file sits in resources to include it into the jar. Because the version
// is needed at runtime.
// 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'
}
}
defaultTasks 'jar'
repositories {
mavenCentral()
}
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:1.2"
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: '
}
dependencies {
compile 'org.projectlombok:lombok:1.16.6'
compile 'log4j:log4j:1.2.17'
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'
}
// Must be called after dependencies
jar {
manifest {
attributes(
"Class-Path": "../../") // ProActive root directory (script-engine sits in dist/lib)
}
}
// 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-docker-compose"
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')}")
}
}
}
}