-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
177 lines (149 loc) · 5.52 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
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
plugins {
id 'java'
//id 'maven'
id 'maven-publish'
id 'signing'
}
//groupID https://docs.gradle.org/current/userguide/publishing_maven.html#sec:identity_values_in_the_generated_pom
// artifactID taken from project name in settings.gradle file
group 'edu.upc.essi.dtim'
//version '0.1.0'
version '0.1.0-SNAPSHOT'
sourceCompatibility = 11
targetCompatibility = 11
repositories {
mavenCentral()
}
dependencies {
// https://mvnrepository.com/artifact/org.apache.jena/apache-jena-libs
implementation group: 'org.apache.jena', name: 'apache-jena-libs', version: '4.1.0', ext: 'pom'
implementation group: 'org.apache.jena', name: 'jena-querybuilder', version: '4.1.0'
implementation group: 'net.minidev', name: 'json-smart', version: '2.4.7'
implementation group: 'javax.json', name: 'javax.json-api', version: '1.1.4'
implementation group: 'org.glassfish', name: 'javax.json', version: '1.1.4'
testImplementation 'junit:junit:4.12'
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.20'
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.20'
////////////////////////////////////////// NextiaCore //////////////////////////////////////////
implementation fileTree(dir: 'lib', include: ['*.jar'])
runtimeOnly(fileTree(dir: 'lib', include: ['*.jar']))
////////////////////////////////////////////////////////////////////////////////////////////////
}
test {
useJUnitPlatform()
}
//task customFatJar(type: Jar) {
// manifest {
// attributes 'Main-Class': 'edu.upc.essi.dtim.Nuupdi'
// }
// baseName = 'all-in-one-jar'
// from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
// with jar
//}
task uberJar(type: Jar) {
duplicatesStrategy = 'exclude'
archiveClassifier = 'uber'
from sourceSets.main.output
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
}
signing {
required {
// signing is required if this is a release version and the artifacts are to be published
!version.toString().endsWith('-SNAPSHOT') && tasks.withType(PublishToMavenRepository).find {
gradle.taskGraph.hasTask it
}
}
sign publishing.publications
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'NextiaDI'
description = 'Agnostic and Incremental Data Integration that facilitates generating graph-based schema of heterogeneous data sources and integrating them.'
url = 'https://www.essi.upc.edu/dtim/nextiadi/'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'jflores'
name = 'Javier Flores'
email = '[email protected]'
url = 'https://www.essi.upc.edu/dtim/people/jflores'
}
}
scm {
connection = 'scm:git:git://github.com/dtim-upc/NextiaDI.git'
developerConnection = 'scm:git:ssh://github.com/dtim-upc/NextiaDI.git'
url = 'https://github.com/dtim-upc/NextiaDI'
}
}
}
}
repositories {
maven {
/*
credentials {
// nexusUsername and nexusPassword are in gradle.properties file.
username nexusUsername
password nexusPassword
}*/
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
//Task to export NextiaCore
task copyJarToOtherProjects() {
uberJar
def ODIN = '..\\ODIN\\api\\lib'
def nextiaDIJarPath = "build/libs/nextiadi-0.1.0-SNAPSHOT-uber.jar"
// Define the target projects
def targetProjects = [ODIN]
// Create a copy task for each project directory
targetProjects.each { path ->
// Ensure the directory exists
new File(path).mkdirs()
// Remove previous versions
new File(path, 'NextiaDI.jar').delete()
new File(path, 'nextiadi-0.1.0-SNAPSHOT-uber.jar').delete()
copy {
println "JAR copying to project: $path"
from nextiaDIJarPath
rename { 'NextiaDI.jar' }
into path
doLast {
println "JAR copied to project: $path"
}
}
}
}
// La tarea de copia a los otros proyectos se ejecuta después de la tarea de generación de JAR
copyJarToOtherProjects.dependsOn uberJar