/
build.gradle
164 lines (135 loc) · 5.04 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
apply plugin: 'maven'
apply plugin: 'eclipse'
defaultTasks 'build'
// builds a gradle wrapper
// http://www.gradle.org/docs/current/userguide/gradle_wrapper.html
//task wrapper(type: Wrapper) {
// gradleVersion = '5.0'
//}
ext {
JAVA_VERSION_SOURCE = 1.8
JAVA_VERSION_CLASSES = 1.8
WINDOWS = 1
MAC = 2
LINUX = 3
X86 = 1
X64 = 2
ARM = 3
ARMHF = 4
ALL = 5
SLF4J_VERSION = '2.0.3'
}
def fromOsName(name) {
name = name.toLowerCase()
if(name.contains("windows")) return WINDOWS
if(name.contains("mac")) return MAC
if(name.contains("linux")) return LINUX
if(name.contains("all")) return ALL
null
}
def fromOsArch(arch) {
arch = arch.toLowerCase()
if(arch.contains("64")) return X64
if(arch.contains("armhf")) return ARMHF
if(arch.contains("arm")) return ARM
if(arch.contains("all")) return ALL
X86
}
// Follow MAJOR.MINOR.REVISION-BUILDNUMBER versioning pattern to
// be consistent with Maven schema.
// http://docs.codehaus.org/display/MAVEN/Versioning
//
// MAJOR changes is backward incompatible and require changing
// project name, path to files, GUIDs, etc.
//
// MINOR changes is backward compatible. Mark introduction of
// new features.
//
// REVISION for security/bug fixes. Backward and forward compatible.
//
//
// For builds in user sandboxes, -SNAPSHOT is the identifier,
// for the CI system -bXXXX where XXX is a build number
//
def BUILD_NUMBER = 'SNAPSHOT'
if(null != System.properties['BUILD_NUMBER']) {
BUILD_NUMBER = System.properties['BUILD_NUMBER']
}
// MDPNP_VERSION_NUMBER is defined in the root gradle.properties file
//
if(null != System.properties['MDPNP_VERSION_NUMBER']) {
MDPNP_VERSION_NUMBER = System.properties['MDPNP_VERSION_NUMBER']
}
ext {
localOsName = fromOsName(System.properties['os.name'])
localOsArch = fromOsArch(System.properties['os.arch'])
targetOsName = project.hasProperty('OS_NAME') ? fromOsName(OS_NAME) : localOsName
targetOsArch = project.hasProperty('OS_ARCH') ? fromOsArch(OS_ARCH) : localOsArch
VERSION_NUMBER = MDPNP_VERSION_NUMBER + ((null!=BUILD_NUMBER&&!"".equals(BUILD_NUMBER))?"-":"") + BUILD_NUMBER
}
group 'org.mdpnp'
subprojects {
apply plugin: 'maven'
apply plugin: 'eclipse'
version VERSION_NUMBER
group 'org.mdpnp'
buildscript {
repositories {
// Repository for external released libs hosted by mdpnp (unavailable in any other repo)
//maven { url 'https://build.openice.info/artifactory/ext-release-local' }
ivy { artifactPattern 'http://gradle-launch4j.googlecode.com/files/[module]-[revision].[ext]' }
mavenCentral()
}
}
repositories {
// Repository for external snapshot libs hosted by mdpnp (unavailable in any other repo)
//maven { url 'https://build.openice.info/artifactory/libs-snapshot'
//}
// Repository for external released libs hosted by mdpnp (unavailable in any other repo)
//maven { url 'https://build.openice.info/artifactory/libs-release' }
// Virtual repository of all remote repositories
// used in the mdpnp project
/*
maven {
// Apply credentials if available to allow deployment into caches
if(project.hasProperty('MDPNP_WRITE_USER') && project.hasProperty('MDPNP_WRITE_PASSWORD')) {
credentials {
username MDPNP_WRITE_USER
password MDPNP_WRITE_PASSWORD
}
}
url 'https://build.openice.info/artifactory/remote-repos' }
*/
// All the following should be covered by the remote-repos repository above
// They are included her for reference (and potentially fallback)
// Repository for javacv/javacpp
maven { url 'http://maven2.javacv.googlecode.com/git/' }
// Repository for jogamp
maven { url 'http://www.jogamp.org/deployment/maven/' }
// Repository for restlet
maven { url 'http://maven.restlet.org' }
// specifically javax.transaction.jta 1.0.1B only exists here in jar form (pom only in maven central)
maven { url 'http://download.java.net/maven/2/' }
mavenLocal()
// Fall back to maven central actual as necessary
mavenCentral()
// Is this a VERY slow maven repo?
// maven { url 'http://maven.eclipse.org' }
}
/*
if(project.hasProperty('MDPNP_WRITE_USER') && project.hasProperty('MDPNP_WRITE_PASSWORD')) {
uploadArchives {
repositories {
mavenDeployer {
repository(url: 'https://build.openice.info/artifactory/libs-release-local') {
authentication(userName: MDPNP_WRITE_USER, password: MDPNP_WRITE_PASSWORD)
}
snapshotRepository(url: 'https://build.openice.info/artifactory/libs-snapshot-local') {
authentication(userName: MDPNP_WRITE_USER, password: MDPNP_WRITE_PASSWORD)
}
}
}
}
}
*/
}