-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.gradle
156 lines (134 loc) · 3.83 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
/*
* Copyright (c) 2009-2010 Clark & Parsia, LLC. <http://www.clarkparsia.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'java'
apply plugin: 'idea'
wrapper {
gradleVersion = '5.4.1'
distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}
ext {
stardogVersion = "6.1.3"
projectVersion = "1.0"
projectDescription = "JPA implementation for RDF"
projectUrl = "https://github.com/mhgrove/Empire"
}
allprojects {
apply plugin: 'eclipse'
group = "com.clarkparsia.empire"
version = projectVersion
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
mavenCentral()
maven {
url "http://maven.stardog.com"
}
}
}
subprojects {
apply plugin: "java"
apply plugin: "maven"
dependencies {
compile 'org.slf4j:slf4j-api:1.7.7'
compile 'org.slf4j:slf4j-jdk14:1.7.7'
testCompile 'junit:junit:4.8.2'
}
configurations {
// ignore
compile.dependencies.all { dep ->
if (dep instanceof ExternalModuleDependency
&& (dep.group == 'org.openrdf.sesame' || dep.group == 'com.complexible.common')) {
dep.exclude group: "junit"
}
}
}
sourceSets {
main {
java {
srcDir 'main/src'
}
resources {
srcDir 'main/resources'
}
}
test {
java {
srcDir 'test/src'
}
resources {
srcDir 'test/resources'
}
}
}
// create a 'tests' conf for importing test classes from other sub-projects
task testJar(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
from sourceSets.test.output
}
artifacts {
testRuntime testJar // include the tests of other subprojects
}
if (project.hasProperty('publishUrl')
&& project.hasProperty('artifactoryUser')
&& project.hasProperty('artifactoryPassword')) {
// this task is just so artifactory picks up the pom changes
task('uploadMvn', type: Upload) {
configuration = configurations.archives
repositories {
mavenDeployer {
repository(url: publishUrl)
pom.project {
name = archivesBaseName
packaging = 'jar'
description projectDescription
url projectUrl
}
//mess with the generated pom to remove test dependencies from published artifacts
pom.withXml { XmlProvider xmlProvider ->
def xml = xmlProvider.asString()
def pomXml = new XmlParser().parse(new ByteArrayInputStream(xml.toString().bytes))
pomXml.dependencies.dependency.each { dep ->
if (dep.scope.text() != 'compile') {
def parent = dep.parent()
parent.remove(dep)
}
}
def newXml = new StringWriter()
def printer = new XmlNodePrinter(new PrintWriter(newXml))
printer.preserveWhitespace = true
printer.print(pomXml)
xml.setLength(0)
xml.append(newXml.toString())
}
}
}
}
}
}
evaluationDependsOnChildren()
subprojects {
task javadocs(type: Javadoc) {
source sourceSets.main.allJava
classpath = configurations.compile
destinationDir = file("${rootProject.buildDir}/javadocs/${project.name}")
configure(options) {
windowTitle "${project.archivesBaseName}-${project.version} API"
docTitle "${project.archivesBaseName}-${project.version}"
bottom "Copyright © 2010-2015 Complexible. All Rights Reserved."
links "http://docs.oracle.com/javase/8/docs/api/",
"http://docs.guava-libraries.googlecode.com/git-history/v18.0/javadoc/"
}
}
}