-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild-standalone.gradle
145 lines (126 loc) · 4.16 KB
/
build-standalone.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
plugins {
id 'java'
// Publish the generated resources as Maven Artifacts
// See: https://docs.gradle.org/5.0/userguide/publishing_overview.html#publishing_overview
id 'maven-publish'
}
repositories {
mavenCentral()
}
// Useful for Java only development
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
def sdkVersion = '0.5.0'
ext {
githubUrl = 'https://github.com/pydio/cells-sdk-java.git'
}
// Also publish sources and Javadoc
java {
// Temporary disable javadoc, they are broken after updating to java 17 and gradle 8.1
// withJavadocJar()
withSourcesJar()
}
// Skip integration tests by default
test {
if (System.properties['test.profile'] != 'integration') {
exclude '**/integration/*'
}
}
// Pre-create the pom configuration:
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "cdujeu"
name "Charles du Jeu"
email "[email protected]"
}
developer {
id "bsinou"
name "Bruno Sinou"
email "[email protected]"
}
}
scm {
url githubUrl
}
}
publishing {
publications {
CellsSdk(MavenPublication) {
from components.java
groupId 'com.pydio.cells'
artifactId 'cells-sdk-java'
version = sdkVersion
pom.withXml {
def root = asNode
root.appendNode('description', 'Provide base java libraries to communicate with the Pydio Cells stack')
root.appendNode('name', 'Cells SDK for Java')
root.appendNode('url', 'https://pydio.com')
root.children().last() + pomConfig
}
}
}
}
jar {
manifest {
attributes('Specification-Title': 'Cells SDK for Java',
'Specification-Version': '4.9',
'Specification-Vendor': 'Abstrium SAS',
'Implementation-Title': project.name,
'Implementation-Vendor': 'Abstrium SAS',
'Implementation-Version': sdkVersion)
}
}
dependencies {
// Necessary for swagger (generation of the openapi package from Cells spec)
implementation libs.swagger.annotations
// Add the @Nullable annotation
implementation libs.jsr305
implementation libs.commons.codec
implementation libs.okhttp
// Used to store info as gson blobs in SQLite
implementation libs.google.gson
// gsonfire library adds some more feature (like date de-serialization) to the basic GSON library
// It is used by the swagger generated SDK code.
implementation libs.gson.fire
implementation libs.threetenbp
implementation libs.jackson.databind
implementation libs.logging.interceptor
// https://mvnrepository.com/artifact/jakarta.ws.rs/jakarta.ws.rs-api
implementation libs.jakarta.ws.rs.api
// Necessary when developing / building with a JDK 11
implementation libs.javax.annotation.api
// JUnit test framework
testImplementation libs.junit
// JUnit test framework
testImplementation libs.junit
// S3 transport is configured in calling layer and use a specific either Java or Android implementation.
// See cells-android-client or cells-java-client repos.
}
// Helper tasks to debug
// Uncomment this to get more messages during build for code cleaning sprints.
// tasks.withType(JavaCompile) {
// options.compilerArgs << '-Xlint:unchecked'
// options.deprecation = true
// }
tasks.register('printSourceSetInformation') {
doLast {
sourceSets.each { srcSet ->
println "[" + srcSet.name + "]"
print "-->Source directories: " + srcSet.allJava.srcDirs + "\n"
print "-->Output directories: " + srcSet.output.classesDirs.files + "\n"
print "-->Compile classpath:\n"
srcSet.compileClasspath.files.each {
print " " + it.path + "\n"
}
println ""
}
}
}