Skip to content

Commit 685a638

Browse files
committed
add convenience task for github artifacts
1 parent 1fbf1f0 commit 685a638

File tree

2 files changed

+60
-36
lines changed

2 files changed

+60
-36
lines changed

build-gui/build.gradle

+31-18
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
plugins {
2-
id 'java'
3-
id 'application'
4-
id 'edu.sc.seis.launch4j' version '2.5.4'
5-
id 'org.openjfx.javafxplugin' version '0.1.0'
6-
id 'com.github.johnrengelman.shadow' version '7.1.2'
2+
id "java"
3+
id "application"
4+
id "edu.sc.seis.launch4j" version "2.5.4"
5+
id "org.openjfx.javafxplugin" version "0.1.0"
6+
id "com.github.johnrengelman.shadow" version "7.1.2"
77
}
88

99
group = ss_group
10-
version = '4.3.1'
10+
version = "4.3.1"
1111

1212
repositories {
1313
mavenCentral()
1414
}
1515

1616
dependencies {
17-
implementation project(':build-shared') // This makes shared classes available
17+
implementation project(":build-shared") // This makes shared classes available
1818

19-
implementation 'com.eclipsesource.minimal-json:minimal-json:0.9.5'
20-
implementation 'info.picocli:picocli:4.7.5'
21-
annotationProcessor 'info.picocli:picocli-codegen:4.7.5'
22-
implementation fileTree(dir: 'libs', include: '*.jar')
19+
implementation "com.eclipsesource.minimal-json:minimal-json:0.9.5"
20+
implementation "info.picocli:picocli:4.7.5"
21+
annotationProcessor "info.picocli:picocli-codegen:4.7.5"
22+
implementation fileTree(dir: "libs", include: "*.jar")
2323

2424
//Dependencies (GUI)
2525
implementation "org.openjfx:javafx-controls:$javafx.version:win"
@@ -39,7 +39,7 @@ application {
3939

4040
javafx {
4141
version = "17.0.13"
42-
modules = ['javafx.controls']
42+
modules = ["javafx.controls"]
4343
}
4444

4545
jar {
@@ -48,8 +48,8 @@ jar {
4848

4949
// Configure the shadowJar task (with JavaFX)
5050
shadowJar {
51-
archiveBaseName = 'server-sync'
52-
archiveClassifier = 'client'
51+
archiveBaseName = "server-sync"
52+
archiveClassifier = "client"
5353

5454
//Don't minimize with JavaFX
5555
//minimize() //Comment to build GUI
@@ -59,20 +59,20 @@ shadowJar {
5959
}
6060

6161
manifest {
62-
attributes 'Main-Class': ss_main_class
63-
attributes 'Implementation-Version': project.version
62+
attributes "Main-Class": ss_main_class
63+
attributes "Implementation-Version": project.version
6464
}
6565

6666
dependencies {
67-
exclude 'forge*.jar'
67+
exclude "forge*.jar"
6868
//exclude '**/*javafx*/**' //Comment to build GUI
6969
}
7070
}
7171

7272
createExe {
7373
jarTask = shadowJar
7474
mainClassName = ss_main_class
75-
outfile = 'ServerSyncClient.exe'
75+
outfile = "ServerSyncClient.exe"
7676
icon = "${rootDir}/build-shared/src/main/resources/ServersyncLogo.ico"
7777
copyConfigurable = shadowJar.outputs.files
7878
supportUrl = "https://github.com/superzanti/ServerSync"
@@ -104,3 +104,16 @@ distributions {
104104
}
105105
}
106106
}
107+
108+
tasks.register("assembleGithubArtifacts", Copy) {
109+
group = "distribution"
110+
dependsOn createExe
111+
from layout.buildDirectory.dir("launch4j/lib"), layout.buildDirectory.file("launch4j")
112+
into file("$rootDir/publish/github")
113+
exclude "lib"
114+
}
115+
116+
clean {
117+
delete "$rootDir/publish"
118+
}
119+

build-server/build.gradle

+29-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
plugins {
2-
id 'java'
3-
id 'application'
4-
id 'edu.sc.seis.launch4j' version '2.5.4'
5-
id 'com.github.johnrengelman.shadow' version '7.1.2'
2+
id "java"
3+
id "application"
4+
id "edu.sc.seis.launch4j" version "2.5.4"
5+
id "com.github.johnrengelman.shadow" version "7.1.2"
66
}
77

88
group = ss_group
9-
version = '4.3.1'
9+
version = "4.3.1"
1010

1111
repositories {
1212
mavenCentral()
1313
}
1414

1515
dependencies {
16-
implementation project(':build-shared') // This makes shared classes available
16+
implementation project(":build-shared") // This makes shared classes available
1717

18-
implementation 'info.picocli:picocli:4.7.5'
19-
annotationProcessor 'info.picocli:picocli-codegen:4.7.5'
20-
implementation fileTree(dir: 'libs', include: '*.jar')
18+
implementation "info.picocli:picocli:4.7.5"
19+
annotationProcessor "info.picocli:picocli-codegen:4.7.5"
20+
implementation fileTree(dir: "libs", include: "*.jar")
2121
}
2222

2323
java {
@@ -34,33 +34,32 @@ application {
3434
mainClass = ss_main_class
3535
}
3636

37-
// Configure the shadowJar task (with JavaFX)
3837
shadowJar {
39-
archiveBaseName = 'server-sync'
40-
archiveClassifier = 'server'
38+
archiveBaseName = "server-sync"
39+
archiveClassifier = "server"
4140

4241
processResources {
4342
exclude "css/application.css"
4443
}
4544

4645
manifest {
47-
attributes 'Main-Class': ss_main_class
48-
attributes 'Implementation-Version': project.version
46+
attributes "Main-Class": ss_main_class
47+
attributes "Implementation-Version": project.version
4948
}
5049

5150
minimize()
5251

5352
dependencies {
54-
exclude 'forge*.jar'
55-
exclude '**/*javafx*/**' //Comment to build GUI
53+
exclude "forge*.jar"
54+
exclude "**/*javafx*/**"
5655
}
5756
}
5857

5958
createExe {
6059
jarTask = shadowJar
6160
mainClassName = ss_main_class
62-
outfile = 'ServerSyncServer.exe'
63-
headerType = 'console'
61+
outfile = "ServerSyncServer.exe"
62+
headerType = "console"
6463
icon = "${rootDir}/build-shared/src/main/resources/ServersyncLogoServer.ico"
6564
copyConfigurable = shadowJar.outputs.files
6665
supportUrl = "https://github.com/superzanti/ServerSync"
@@ -90,4 +89,16 @@ distributions {
9089
from(shadowJar)
9190
}
9291
}
92+
}
93+
94+
tasks.register("assembleGithubArtifacts", Copy) {
95+
group = "distribution"
96+
dependsOn createExe
97+
from layout.buildDirectory.dir("launch4j/lib"), layout.buildDirectory.file("launch4j")
98+
into file("$rootDir/publish/github")
99+
exclude "lib"
100+
}
101+
102+
clean {
103+
delete "$rootDir/publish"
93104
}

0 commit comments

Comments
 (0)