forked from pieterhijma/cashmere
/
build.gradle
199 lines (173 loc) · 5.5 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
plugins {
id 'java-library'
id 'maven'
id 'signing'
id 'distribution'
}
def static getOsString() {
String vendor = System.getProperty("java.vendor");
if ("The Android Project" == vendor) {
return "android";
} else {
String osName = System.getProperty("os.name");
osName = osName.toLowerCase(Locale.ENGLISH);
if (osName.startsWith("windows")) {
return "windows";
} else if (osName.startsWith("mac os")) {
return "apple";
} else if (osName.startsWith("linux")) {
return "linux";
} else if (osName.startsWith("sun")) {
return "sun"
}
return "unknown"
}
}
def static getArchString() {
String osArch = System.getProperty("os.arch");
osArch = osArch.toLowerCase(Locale.ENGLISH);
if ("i386" == osArch || "x86" == osArch || "i686" == osArch) {
return "x86";
} else if (osArch.startsWith("amd64") || osArch.startsWith("x86_64")) {
return "x86_64";
} else if (osArch.startsWith("arm64")) {
return "arm64";
} else if (osArch.startsWith("arm")) {
return "arm";
} else if ("ppc" == osArch || "powerpc" == osArch) {
return "ppc";
} else if (osArch.startsWith("ppc")) {
return "ppc_64";
} else if (osArch.startsWith("sparc")) {
return "sparc";
} else if (osArch.startsWith("mips64")) {
return "mips64";
} else if (osArch.startsWith("mips")) {
return "mips";
} else if (osArch.contains("risc")) {
return "risc";
}
return "unknown";
}
dependencies {
def classifier = getOsString()+'-'+getArchString()
compile (group: 'org.jcuda', name: 'jcuda', version: '0.8.0',){
transitive=false
}
compile group: 'org.jcuda', name: 'jcuda-natives', classifier: classifier, version: '0.8.0'
api 'org.jocl:jocl:2.0.4'
api 'nl.junglecomputing:constellation:2.0.1'
api 'nl.junglecomputing.ipl:ipl-support:2.3.3'
implementation 'org.slf4j:slf4j-api:1.7.21'
implementation 'nl.junglecomputing.ipl:ibis-util:2.3.3'
compile 'org.lucee:commons-io:2.4.0'
}
repositories {
mavenCentral()
}
version = '0.4'
group = 'nl.junglecomputing.cashmere'
archivesBaseName = 'cashmere'
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
javadoc.failOnError = false
javadoc.options.memberLevel = JavadocMemberLevel.PUBLIC
javadoc.options.links "https://JungleComputing.github.io/Constellation"
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
uploadArchives {
repositories {
mavenDeployer {
configurations.archives.artifacts.removeAll {PublishArtifact publishArtifact -> publishArtifact.type == 'tar'}
configurations.archives.artifacts.removeAll {PublishArtifact publishArtifact -> publishArtifact.type == 'zip'}
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
// repository(url: "file://${System.properties['user.home']}/.m2/repository") {
// }
signing {
sign configurations.archives
}
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Cashmere'
packaging 'jar'
description 'Cashmere is a programming system for heterogeneous compute clusters with many-core devices such as GPUs.'
url 'https://github.com/junglecomputing/cashmere'
scm {
connection 'scm:git:git://github.com/junglecomputing/cashmere.git'
developerConnection 'scm:git:ssh://github.com:junglecomputing/cashmere.git'
url 'https://github.com/junglecomputing/cashmere/tree/master'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'Pieter Hijma'
organization = 'Vrije Universiteit Amsterdam'
url = 'https://github.com/pieterhijma'
}
developer {
name = 'Ceriel Jacobs'
organization = 'Vrije Universiteit Amsterdam'
url = 'https://github.com/CerielJacobs'
}
}
}
}
}
}
task copyJavadoc(type: Copy) {
description 'Copy Java documentation to site'
group 'Publishing'
from "build/docs"
into "docs/versions/${version}"
dependsOn 'javadoc'
}
distZip.dependsOn jar
distTar.dependsOn jar
installDist.dependsOn jar
jar {
from('src/main/java/example/kmeans') {
include '*.cl'
include '*.cu'
}
from('src/main/java/example/mmult') {
include '*.cl'
include '*.cu'
}
from('src/main/java/example/vectoradd') {
include '*.cl'
include '*.cu'
}
}
distributions {
main {
baseName = project.name
contents {
from 'log4j.properties'
into('bin') {
from 'scripts'
}
into('lib') {
from configurations.runtimeClasspath
from jar.archivePath
}
}
}
}