1
1
plugins {
2
- id( " java" )
2
+ java
3
3
}
4
4
5
5
repositories{
6
6
mavenCentral()
7
7
google()
8
- maven { url = uri (" https://jogamp.org/deployment/maven" ) }
8
+ maven(" https://jogamp.org/deployment/maven" )
9
9
}
10
10
11
11
sourceSets{
@@ -47,13 +47,15 @@ tasks.compileJava{
47
47
// LEGACY TASKS
48
48
// Most of these are shims to be compatible with the old build system
49
49
// They should be removed in the future, as we work towards making things more Gradle-native
50
- tasks.register<Copy >(" extraResources" ){
51
- dependsOn(" :java:copyCore" )
50
+ val javaMode = { path : String -> layout.buildDirectory.dir(" resources-bundled/common/modes/java/$path " ) }
51
+
52
+ val bundle = tasks.register<Copy >(" extraResources" ){
53
+ dependsOn(" copyCore" )
52
54
from(" ." )
53
55
include(" keywords.txt" )
54
56
include(" theme/**/*" )
55
57
include(" application/**/*" )
56
- into( layout.buildDirectory.dir( " resources-bundled/common/modes/java " ))
58
+ into(javaMode( " " ))
57
59
}
58
60
tasks.register<Copy >(" copyCore" ){
59
61
val coreProject = project(" :core" )
@@ -65,8 +67,8 @@ tasks.register<Copy>("copyCore"){
65
67
into(coreProject.layout.projectDirectory.dir(" library" ))
66
68
}
67
69
68
- val libraries = arrayOf(" dxf" ," io" ," net" , " pdf " ," serial" ," svg" )
69
- libraries .forEach { library ->
70
+ val legacyLibraries = arrayOf(" dxf" ," io" ," net" ," serial" ," svg" )
71
+ legacyLibraries .forEach { library ->
70
72
tasks.register<Copy >(" library-$library -extraResources" ){
71
73
val build = project(" :java:libraries:$library " ).tasks.named(" build" )
72
74
build.configure {
@@ -77,10 +79,30 @@ libraries.forEach { library ->
77
79
include(" *.properties" )
78
80
include(" library/**/*" )
79
81
include(" examples/**/*" )
80
- into( layout.buildDirectory.dir(" resources-bundled/common/modes/java/libraries/$library " ))
82
+ into( javaMode(" /libraries/$library " ))
83
+ }
84
+ bundle.configure {
85
+ dependsOn(" library-$library -extraResources" )
86
+ }
87
+ }
88
+
89
+ val libraries = arrayOf(" pdf" )
90
+ libraries.forEach { library ->
91
+ val name = " create-$library -library"
92
+ tasks.register<Copy >(name) {
93
+ group = " libraries"
94
+ val project = project(" :java:libraries:$library " )
95
+ val libraryTask = project.tasks.named(" createLibrary" )
96
+ dependsOn(libraryTask)
97
+
98
+ from(project.layout.buildDirectory.dir(" library" ))
99
+ into(javaMode(" /libraries/$library " ))
100
+ }
101
+ bundle.configure {
102
+ dependsOn(name)
81
103
}
82
- tasks.named(" extraResources" ){ dependsOn(" library-$library -extraResources" ) }
83
104
}
105
+
84
106
tasks.jar { dependsOn(" extraResources" ) }
85
107
tasks.processResources{ finalizedBy(" extraResources" ) }
86
108
tasks.compileTestJava{ finalizedBy(" extraResources" ) }
0 commit comments