-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
122 lines (79 loc) · 2.45 KB
/
build.gradle
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
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'net.linguica.maven-settings' version '0.5'
}
apply plugin: 'java'
apply plugin: 'maven-publish'
dependencies {
compile group: 'org.springframework', name: 'spring-web', version: '5.3.1'
}
publishing {
publications {
myPublication(MavenPublication) {
groupId 'com.koneksys.rdfizer'
artifactId 'cameo2rdfplugin'
version '0.6'
artifact 'build/pluginzip/cameo2rdfplugin.zip'
}
}
// Repositories *to* which Gradle can publish artifacts
repositories {
maven {
}
}
}
// Repositories *from* which Gradle can download dependencies; it's the same as above in this example
repositories {
maven {
}
}
dependencies {
compileOnly fileTree(dir: System.getenv('CAMEO_INSTALL_DIR') + '/lib', include: '**/*.jar')
compileOnly fileTree(dir: System.getenv('CAMEO_INSTALL_DIR') + '/plugins', include: '**/*.jar')
}
//Creates a jar file with the compiled files
jar {
baseName = 'cameo2rdfplugin'
version = '0.1'
manifest {
attributes("Implementation-Title": "cameo2rdfplugin",
"Implementation-Version": 0.1)
}
//Next line creates a fat jar
//from { configurations.compileClasspath.filter{ it.exists() }.collect { it.isDirectory() ? it : zipTree(it) } }
}
//Defines task to copy files
task copyJar (type: Copy){
//Copy files of the 'somefiles directory'
from 'build/libs'
//Into the current directory
into 'build/plugins/cameo2rdfplugin'
}
//Defines task to copy files
task copyPluginXML (type: Copy){
//Copy files of the 'somefiles directory'
from 'cameopluginxml/plugin.xml'
//Into the current directory
into 'build/plugins/cameo2rdfplugin'
}
//Defines task to copy files
task copyLibs (type: Copy){
//Copy files of the 'somefiles directory'
from 'cameopluginxml/lib'
//Into the current directory
into 'build/plugins/cameo2rdfplugin/lib'
}
task archivePlugin(type: Zip) {
from 'build/plugins/cameo2rdfplugin/'
include "lib/**"
include '*'
archiveName 'cameo2rdfplugin.zip'
destinationDir(file('build/pluginzip/'))
}
//Execute the copy files task after performing the build
build.finalizedBy(copyJar)
build.finalizedBy(copyPluginXML)
build.finalizedBy(copyLibs)
build.finalizedBy(archivePlugin)
//build.finalizedBy(finalize2)