-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
149 lines (120 loc) · 3.31 KB
/
Copy pathbuild.gradle
File metadata and controls
149 lines (120 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
* © Copyright IBM Corporation 2016.
* This is licensed under the following license.
* The Eclipse Public 1.0 License (http://www.eclipse.org/legal/epl-v10.html)
* U.S. Government Users Restricted Rights: Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
plugins {
id 'groovy'
id 'java'
}
group = 'com.ibm.urbancode'
version = project.hasProperty('pluginVersion') ? project.pluginVersion : 'dev'
def pluginName = 'Apple-Xcode-UCD'
repositories {
mavenCentral()
}
// Source sets configuration
sourceSets {
main {
groovy {
srcDirs = ['src/groovy']
}
java {
srcDirs = ['src/java']
}
resources {
srcDirs = ['src']
exclude '**/groovy/**'
exclude '**/java/**'
exclude '**/test/**'
}
}
}
dependencies {
// Runtime Dependencies
implementation 'com.ibm.urbancode.plugins:groovy-plugin-utils:+'
// Build Dependencies - Groovy
implementation 'org.codehaus.groovy:groovy-all:+'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType(GroovyCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
// Task to assemble the plugin
tasks.register('assemblePlugin', Copy) {
dependsOn classes
into layout.buildDirectory.dir("plugin")
// Copy plugin descriptor files
from('plugin') {
include 'info.xml'
include 'upgrade.xml'
include 'plugin.xml'
}
// Copy source scripts (excluding groovy/java/test directories)
from('src') {
exclude '**/groovy/**'
exclude '**/java/**'
exclude '**/test/**'
}
// Copy license
into('license') {
from('license') {
include 'EPL.txt'
}
}
// Copy documentation
into('doc') {
from('doc') {
include 'HowTo.html'
}
}
}
// Copy libraries to plugin
tasks.register('copyLibs', Copy) {
dependsOn configurations.runtimeClasspath
into layout.buildDirectory.dir("plugin/lib")
from(configurations.runtimeClasspath) {
// Include all runtime dependencies
}
}
// Copy Groovy source files to classes directory (for runtime interpretation)
tasks.register('copyGroovySources', Copy) {
into layout.buildDirectory.dir("plugin/classes")
from('src/groovy') {
include '**/*.groovy'
}
}
// Copy compiled Java classes
tasks.register('copyCompiledClasses', Copy) {
dependsOn compileJava
into layout.buildDirectory.dir("plugin/classes")
from(sourceSets.main.java.classesDirectory) {
include '**/*.class'
}
}
// Create the plugin distribution zip
tasks.register('dist', Zip) {
dependsOn 'assemblePlugin', 'copyLibs', 'copyGroovySources', 'copyCompiledClasses'
archiveFileName = "${pluginName}-${version}.zip"
destinationDirectory = file('releases')
from layout.buildDirectory.dir("plugin")
}
// Main build task
tasks.register('buildPlugin') {
dependsOn 'dist'
doLast {
println "Plugin build complete!"
}
}
// Clean task enhancement
clean {
delete 'releases'
delete 'lib'
}
// Default task
defaultTasks 'buildPlugin'