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