Skip to content

Commit c3acbc6

Browse files
committed
Update build.gradle
1 parent f726624 commit c3acbc6

File tree

1 file changed

+147
-148
lines changed

1 file changed

+147
-148
lines changed

build.gradle

Lines changed: 147 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
plugins {
2-
id 'java'
3-
id 'maven'
4-
id 'maven-publish'
5-
id 'java-gradle-plugin'
2+
id 'java'
3+
id 'maven'
4+
id 'maven-publish'
5+
id 'java-gradle-plugin'
66
id 'com.gradle.plugin-publish' version '0.12.0'
7-
id 'io.codearte.nexus-staging' version '0.21.2'
8-
id 'eclipse'
7+
id 'io.codearte.nexus-staging' version '0.21.2'
8+
id 'eclipse'
99
id 'de.undercouch.download' version '4.1.1'
1010
}
1111

@@ -18,12 +18,12 @@ repositories {
1818
}
1919

2020
gradlePlugin {
21-
plugins {
22-
javaPackagerPlugin {
23-
id = 'io.github.fvarrui.javapackager.plugin'
24-
implementationClass = 'io.github.fvarrui.javapackager.gradle.PackagePlugin'
25-
}
26-
}
21+
plugins {
22+
javaPackagerPlugin {
23+
id = 'io.github.fvarrui.javapackager.plugin'
24+
implementationClass = 'io.github.fvarrui.javapackager.gradle.PackagePlugin'
25+
}
26+
}
2727
}
2828

2929
pluginBundle {
@@ -39,38 +39,38 @@ pluginBundle {
3939
}
4040

4141
configurations {
42-
mavenEmbedder
42+
mavenEmbedder
4343
}
4444

4545
dependencies {
46-
implementation 'org.apache.maven:maven-plugin-api:3.6.0'
47-
implementation 'org.codehaus.plexus:plexus-utils:3.1.1'
48-
implementation 'org.twdata.maven:mojo-executor:2.3.0'
49-
implementation 'commons-io:commons-io:2.6'
50-
implementation 'org.apache.commons:commons-lang3:3.9'
51-
implementation 'org.apache.commons:commons-collections4:4.1'
52-
implementation 'org.apache.commons:commons-compress:1.21'
53-
implementation 'org.apache.velocity:velocity-engine-core:2.0'
54-
implementation 'org.vafer:jdeb:1.9'
55-
implementation 'net.jsign:jsign-core:3.1'
56-
implementation 'org.redline-rpm:redline:1.2.10'
57-
implementation 'io.github.fvarrui:launch4j:2.5.2'
58-
59-
testImplementation 'junit:junit:4.12'
60-
61-
compileOnly 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.6.0'
62-
63-
mavenEmbedder 'org.apache.maven:maven-embedder:3.6.0'
64-
mavenEmbedder 'org.apache.maven:maven-compat:3.6.0'
65-
mavenEmbedder 'org.slf4j:slf4j-simple:1.7.30'
66-
mavenEmbedder 'org.eclipse.aether:aether-connector-basic:1.1.0'
67-
mavenEmbedder 'org.eclipse.aether:aether-transport-wagon:1.1.0'
68-
mavenEmbedder 'org.apache.maven.wagon:wagon-http:3.4.1'
69-
mavenEmbedder 'org.apache.maven.wagon:wagon-provider-api:3.4.1'
46+
implementation 'org.apache.maven:maven-plugin-api:3.6.0'
47+
implementation 'org.codehaus.plexus:plexus-utils:3.1.1'
48+
implementation 'org.twdata.maven:mojo-executor:2.3.0'
49+
implementation 'commons-io:commons-io:2.6'
50+
implementation 'org.apache.commons:commons-lang3:3.9'
51+
implementation 'org.apache.commons:commons-collections4:4.1'
52+
implementation 'org.apache.commons:commons-compress:1.21'
53+
implementation 'org.apache.velocity:velocity-engine-core:2.0'
54+
implementation 'org.vafer:jdeb:1.9'
55+
implementation 'net.jsign:jsign-core:3.1'
56+
implementation 'org.redline-rpm:redline:1.2.10'
57+
implementation 'io.github.fvarrui:launch4j:2.5.2'
58+
59+
testImplementation 'junit:junit:4.12'
60+
61+
compileOnly 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.6.0'
62+
63+
mavenEmbedder 'org.apache.maven:maven-embedder:3.6.0'
64+
mavenEmbedder 'org.apache.maven:maven-compat:3.6.0'
65+
mavenEmbedder 'org.slf4j:slf4j-simple:1.7.30'
66+
mavenEmbedder 'org.eclipse.aether:aether-connector-basic:1.1.0'
67+
mavenEmbedder 'org.eclipse.aether:aether-transport-wagon:1.1.0'
68+
mavenEmbedder 'org.apache.maven.wagon:wagon-http:3.4.1'
69+
mavenEmbedder 'org.apache.maven.wagon:wagon-provider-api:3.4.1'
7070
}
7171

7272
group = 'io.github.fvarrui'
73-
version = '1.6.6'
73+
version = '1.6.7-SNAPSHOT'
7474
description = 'Hybrid Maven/Gradle plugin to package Java applications as native Windows, Mac OS X or GNU/Linux executables and create installers for them'
7575

7676
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -79,145 +79,144 @@ targetCompatibility = JavaVersion.VERSION_1_8
7979
compileJava.options.encoding = 'UTF-8'
8080

8181
publishing {
82-
publications {
83-
mavenJava(MavenPublication) {
84-
from(components.java)
82+
publications {
83+
mavenJava(MavenPublication) {
84+
from(components.java)
8585
}
86-
}
86+
}
8787
}
8888

8989
install.repositories.mavenInstaller.pom.with {
90-
groupId = project.group
91-
artifactId = project.name
92-
version = project.version
90+
groupId = project.group
91+
artifactId = project.name
92+
version = project.version
9393
description = project.description
94-
packaging = 'maven-plugin'
94+
packaging = 'maven-plugin'
9595
}
9696

9797
build.dependsOn ':winrun4j-launcher:build'
9898

9999
// runs the plugin description generator
100100
task generatePluginDescriptor(type: JavaExec, dependsOn: compileJava) {
101101

102-
def pomFile = file("$buildDir/pom.xml")
103-
def pluginDescriptorFile = new File(project.compileJava.destinationDir, 'META-INF/maven/plugin.xml')
104-
def directory = buildDir.canonicalPath
105-
def outputDirectory = compileJava.destinationDir.canonicalPath
106-
107-
// FIXME: this does not seem to be working
108-
inputs.files project.compileJava.outputs.files
109-
outputs.file pluginDescriptorFile
110-
111-
classpath = configurations.mavenEmbedder
112-
main = 'org.apache.maven.cli.MavenCli'
113-
systemProperties['maven.multiModuleProjectDirectory'] = projectDir
114-
args = [
115-
'--errors',
116-
'--batch-mode',
117-
'--file', "${buildDir}/pom.xml",
118-
'org.apache.maven.plugins:maven-plugin-plugin:3.6.0:descriptor',
119-
'-Dproject.build.sourceEncoding=' + compileJava.options.encoding
120-
]
121-
122-
doFirst {
123-
install.repositories
124-
.mavenInstaller
125-
.pom
126-
.withXml {
127-
asNode().appendNode('repositories').appendNode('repository')
128-
.with {
129-
appendNode('id', 'gradle')
130-
appendNode('name', 'Gradle Plugin Portal')
131-
appendNode('url', 'https://plugins.gradle.org/m2/')
132-
}
133-
asNode().appendNode('build')
134-
.with {
135-
appendNode('directory', directory)
136-
appendNode('outputDirectory', outputDirectory)
137-
}
138-
}
139-
.writeTo(pomFile)
140-
141-
assert pomFile.file, "${pomFile.canonicalPath}: was not generated"
142-
logger.info("POM is generated in ${pomFile.canonicalPath}")
143-
}
144-
145-
doLast {
146-
assert pluginDescriptorFile.file, "${pluginDescriptorFile.canonicalPath}: was not generated"
147-
logger.info("Plugin descriptor is generated in ${pluginDescriptorFile.canonicalPath}")
148-
}
102+
def pomFile = file("$buildDir/pom.xml")
103+
def pluginDescriptorFile = new File(project.compileJava.destinationDir, 'META-INF/maven/plugin.xml')
104+
def directory = buildDir.canonicalPath
105+
def outputDirectory = compileJava.destinationDir.canonicalPath
106+
107+
// FIXME: this does not seem to be working
108+
inputs.files project.compileJava.outputs.files
109+
outputs.file pluginDescriptorFile
110+
111+
classpath = configurations.mavenEmbedder
112+
main = 'org.apache.maven.cli.MavenCli'
113+
systemProperties['maven.multiModuleProjectDirectory'] = projectDir
114+
args = [
115+
'--errors',
116+
'--batch-mode',
117+
'--file', "${buildDir}/pom.xml",
118+
'org.apache.maven.plugins:maven-plugin-plugin:3.6.0:descriptor',
119+
'-Dproject.build.sourceEncoding=' + compileJava.options.encoding
120+
]
121+
122+
doFirst {
123+
install.repositories
124+
.mavenInstaller
125+
.pom
126+
.withXml {
127+
asNode().appendNode('repositories').appendNode('repository')
128+
.with {
129+
appendNode('id', 'gradle')
130+
appendNode('name', 'Gradle Plugin Portal')
131+
appendNode('url', 'https://plugins.gradle.org/m2/')
132+
}
133+
asNode().appendNode('build')
134+
.with {
135+
appendNode('directory', directory)
136+
appendNode('outputDirectory', outputDirectory)
137+
}
138+
}
139+
.writeTo(pomFile)
140+
141+
assert pomFile.file, "${pomFile.canonicalPath}: was not generated"
142+
logger.info("POM is generated in ${pomFile.canonicalPath}")
143+
}
144+
145+
doLast {
146+
assert pluginDescriptorFile.file, "${pluginDescriptorFile.canonicalPath}: was not generated"
147+
logger.info("Plugin descriptor is generated in ${pluginDescriptorFile.canonicalPath}")
148+
}
149149
}
150150

151151
project.jar.dependsOn(generatePluginDescriptor)
152152
publishToMavenLocal.dependsOn(build)
153153

154154
if (project.hasProperty('release')) {
155155

156-
apply plugin: 'signing'
157-
apply plugin: 'maven'
156+
apply plugin: 'signing'
157+
apply plugin: 'maven'
158158

159159
task javadocJar(type: Jar) {
160-
classifier = 'javadoc'
161-
from javadoc
160+
classifier = 'javadoc'
161+
from javadoc
162162
}
163163

164164
task sourcesJar(type: Jar) {
165-
classifier = 'sources'
166-
from sourceSets.main.allSource
165+
classifier = 'sources'
166+
from sourceSets.main.allSource
167167
}
168168

169169
artifacts {
170-
archives javadocJar, sourcesJar
170+
archives javadocJar, sourcesJar
171171
}
172172

173-
// Signature of artifacts
174-
signing {
175-
sign configurations.archives
176-
}
177-
178-
// OSSRH publication
179-
uploadArchives {
180-
repositories {
181-
mavenDeployer {
182-
// POM signature
183-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
184-
// Target repository
185-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
186-
authentication(userName: ossrhUser, password: ossrhPassword)
187-
}
188-
pom.project {
189-
name project.name
190-
description project.description
191-
packaging = 'maven-plugin'
192-
url 'https://github.com/fvarrui/JavaPackager'
193-
194-
scm {
195-
connection 'scm:git:git://github.com/fvarrui/JavaPackager.git'
196-
developerConnection 'scm:git:git@github.com:fvarrui/fvarrui.git'
197-
url 'https://github.com/fvarrui/JavaPackager'
198-
}
199-
200-
licenses {
201-
license {
202-
name 'GPL-v3.0'
203-
url 'http://www.gnu.org/licenses/gpl-3.0.txt'
204-
distribution 'repo'
205-
}
206-
}
207-
208-
developers {
209-
developer {
210-
id = 'fvarrui'
211-
name = 'Francisco Vargas Ruiz'
212-
url = 'https://github.com/fvarrui'
213-
}
214-
}
215-
}
216-
}
217-
}
218-
219-
}
220-
173+
// Signature of artifacts
174+
signing {
175+
sign configurations.archives
176+
}
177+
178+
// OSSRH publication
179+
uploadArchives {
180+
repositories {
181+
mavenDeployer {
182+
// POM signature
183+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
184+
// Target repository
185+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
186+
authentication(userName: ossrhUser, password: ossrhPassword)
187+
}
188+
pom.project {
189+
name project.name
190+
description project.description
191+
packaging = 'maven-plugin'
192+
url 'https://github.com/fvarrui/JavaPackager'
193+
194+
scm {
195+
connection 'scm:git:git://github.com/fvarrui/JavaPackager.git'
196+
developerConnection 'scm:git:git@github.com:fvarrui/fvarrui.git'
197+
url 'https://github.com/fvarrui/JavaPackager'
198+
}
199+
200+
licenses {
201+
license {
202+
name 'GPL-v3.0'
203+
url 'http://www.gnu.org/licenses/gpl-3.0.txt'
204+
distribution 'repo'
205+
}
206+
}
207+
208+
developers {
209+
developer {
210+
id = 'fvarrui'
211+
name = 'Francisco Vargas Ruiz'
212+
url = 'https://github.com/fvarrui'
213+
}
214+
}
215+
}
216+
}
217+
}
218+
}
219+
221220
}
222221

223222
nexusStaging {

0 commit comments

Comments
 (0)