1
+ buildscript {
2
+ repositories {
3
+ mavenCentral()
4
+ }
5
+ dependencies {
6
+ classpath(" org.springframework.boot:spring-boot-gradle-plugin:1.5.9.RELEASE" )
7
+ }
8
+ }
9
+
1
10
plugins {
2
11
id ' net.researchgate.release' version ' 2.4.0'
3
- id ' com.github.johnrengelman.shadow' version ' 1.2.3'
4
12
id ' io.codearte.nexus-staging' version ' 0.9.0'
13
+ id ' org.springframework.boot' version ' 1.5.9.RELEASE'
5
14
}
6
15
7
- apply plugin : ' maven'
8
16
apply plugin : ' java'
9
- apply plugin : ' idea'
10
- apply plugin : ' application'
11
- apply plugin : ' project-report'
12
- apply plugin : ' signing'
13
-
14
- nexusStaging {
15
- username= sonatypeUsername
16
- password= sonatypePassword
17
- packageGroup= ' de.otto'
18
- }
19
-
20
- static version () {
21
- return ' 2.3.6-SNAPSHOT'
22
- }
23
-
24
- static isReleaseBuild () {
25
- return ! version(). contains(" SNAPSHOT" )
26
- }
27
-
28
- ext. pomVersion = version()
29
-
30
- mainClassName = ' de.otto.jlineup.Main'
31
17
32
18
repositories {
33
19
mavenCentral()
@@ -36,152 +22,67 @@ repositories {
36
22
maven { url " https://oss.sonatype.org/content/repositories/snapshots/" }
37
23
}
38
24
39
- dependencies {
40
- compile(" org.seleniumhq.selenium:selenium-java:3.7.0" ) {
41
- exclude module : " selenium-edge-driver"
42
- exclude module : " selenium-ie-driver"
43
- exclude module : " selenium-opera-driver"
44
- exclude module : " selenium-safari-driver"
45
- exclude module : " htmlunit"
46
- }
47
- compile " io.github.bonigarcia:webdrivermanager:2.0.1"
48
- compile " com.codeborne:phantomjsdriver:1.4.3"
49
- compile " com.beust:jcommander:1.72"
50
- compile " com.google.code.gson:gson:2.8.2"
51
- compile " ch.qos.logback:logback-classic:1.2.3"
52
- compile " org.thymeleaf:thymeleaf:3.0.8.RELEASE"
53
- testCompile " junit:junit:4.12"
54
- testCompile " org.mockito:mockito-core:2.11.0"
55
- testCompile " org.hamcrest:hamcrest-core:1.3"
56
- testCompile " org.hamcrest:hamcrest-library:1.3"
57
- testCompile " com.github.stefanbirkner:system-rules:1.16.1"
58
- }
59
-
60
- test {
61
- testLogging {
62
- exceptionFormat = ' full'
63
- showStandardStreams = true
64
- }
65
- }
66
-
67
- /*
68
- manifest {
69
- attributes 'Implementation-Title': 'JLineup', 'Implementation-Version': version()
70
- }
71
- */
25
+ apply plugin : ' io.codearte.nexus-staging'
72
26
73
- shadowJar {
74
- baseName = ' jlineup '
75
- classifier = null
76
- version = null
27
+ nexusStaging {
28
+ username = sonatypeUsername
29
+ password = sonatypePassword
30
+ packageGroup = ' de.otto '
77
31
}
78
32
79
- idea. project {
80
- jdkName = " 1.8"
81
- languageLevel = " 1.8"
82
- ipr. withXml { provider ->
83
- provider. node. component. find { it. @name == ' VcsDirectoryMappings' }. mapping. @vcs = ' Git'
33
+ apply plugin : ' idea'
34
+ idea {
35
+ project {
36
+ languageLevel = ' 1.8'
37
+ ipr. withXml { provider ->
38
+ provider. node. component. find { it. @name == ' VcsDirectoryMappings' }. mapping. @vcs = ' Git'
39
+ }
84
40
}
85
41
}
86
42
87
- task javadocJar (type : Jar , dependsOn : javadoc) {
88
- classifier = ' javadoc'
89
- from ' build/docs/javadoc'
90
- }
91
-
92
- task sourcesJar (type : Jar ) {
93
- from sourceSets. main. allSource
94
- classifier = ' sources'
95
- }
43
+ subprojects {
96
44
97
- artifacts {
98
- archives sourcesJar
99
- archives javadocJar
100
- archives shadowJar
101
- }
45
+ version = ' 2.4.0-SNAPSHOT'
46
+ group = ' de.otto'
102
47
103
- [distZip, distTar]. each { task -> configurations. archives. artifacts. removeAll
104
- { it. class. simpleName == " ArchivePublishArtifact" && it. archiveTask == task }
105
- task. enabled = false
106
- }
107
-
108
- signing {
109
- required { isReleaseBuild() && gradle. taskGraph. hasTask(' uploadArchives' ) }
110
- sign configurations. archives
111
- }
112
-
113
- tasks. processResources << {
114
- def resourcesDir = project. sourceSets. main. output. resourcesDir
115
- resourcesDir. mkdirs()
116
-
117
- def versionProperties = new File (resourcesDir, " version.properties" )
118
- if (versionProperties) {
119
- def gitVersion = runCommand(" git log -n1 --format=format:%H" )
120
- def fullVersion = version()
121
- versionProperties. text = " \n jlineup.commit = ${ gitVersion} " + " \n jlineup.version = ${ fullVersion} "
122
- }
123
- }
124
-
125
- uploadArchives {
126
- configuration = configurations. archives
127
48
repositories {
128
- mavenDeployer {
129
- beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
130
-
131
- // use this for local upload debugging instead of sonatype
132
- // repository(url: "file://${buildDir}/repo")
133
-
134
- repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
135
- authentication(userName : sonatypeUsername, password : sonatypePassword)
136
- }
137
-
138
- snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots/" ) {
139
- authentication(userName : sonatypeUsername, password : sonatypePassword)
140
- }
49
+ mavenCentral()
50
+ mavenLocal()
51
+ maven { url " https://oss.sonatype.org/content/repositories/releases/" }
52
+ maven { url " https://oss.sonatype.org/content/repositories/snapshots/" }
53
+ }
141
54
142
- pom. groupId = ' de.otto'
143
- pom. artifactId = ' jlineup'
144
- pom. version = version()
55
+ apply plugin : ' java'
56
+ apply plugin : ' application'
57
+ apply plugin : ' project-report'
58
+ apply plugin : ' signing'
59
+ apply plugin : ' idea'
60
+ apply plugin : ' maven'
145
61
146
- pom. project {
147
- name ' JLineup'
148
- packaging ' jar'
149
- description ' Webapp image comparison tool'
150
- url ' http://github.com/otto-de/jlineup'
151
62
152
- scm {
153
- url
' scm:[email protected] :otto-de/jlineup.git'
154
- connection
' scm:[email protected] :otto-de/jlineup.git'
155
- }
63
+ jar {
64
+ manifest. attributes provider : ' gradle'
65
+ }
156
66
157
- licenses {
158
- license {
159
- name ' The Apache Software License, Version 2.0'
160
- url ' http://www.apache.org/licenses/LICENSE-2.0.txt'
67
+ idea {
68
+ module {
69
+ iml {
70
+ withXml {
71
+ def moduleRoot = it. asNode()
72
+ def facetManager = moduleRoot. component. find { component -> component. ' @name' == ' FacetManager' }
73
+ if (! facetManager) {
74
+ facetManager = moduleRoot. appendNode(' component' , [name : ' FacetManager' ])
161
75
}
162
- }
163
76
164
- developers {
165
- developer {
166
- id ' mgeweke'
167
- name ' Marco Geweke'
168
- url ' https://github.com/MediaMarco'
77
+ def springFacet = facetManager. facet. find { facet -> facet. ' @type' == ' Spring' && facet. ' @name' == ' Spring' }
78
+ if (! springFacet) {
79
+ springFacet = facetManager. appendNode(' facet' , [type : ' Spring' , name : ' Spring' ])
80
+ springFacet. appendNode(' configuration' )
169
81
}
170
82
}
171
83
}
172
84
}
173
85
}
174
- }
175
86
176
- static String runCommand (command ) {
177
- Process proc = command. execute()
178
- def out = new StringBuffer ()
179
- proc. consumeProcessOutputStream(out)
180
- proc. consumeProcessErrorStream(out)
181
- proc. waitFor()
182
- def errorlevel = proc. exitValue()
183
- if (errorlevel != 0 ) {
184
- throw new RuntimeException (" exec failed on command: '${ command} ' with errorlevel ${ errorlevel} " . toString())
185
- }
186
- out. toString(). trim()
187
- }
87
+
88
+ }
0 commit comments