-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
97 lines (84 loc) · 2.16 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath group: 'commons-io', name: 'commons-io', version: '2.5'
classpath group: 'org.zeroturnaround', name: 'zt-zip', version: '1.9'
}
}
apply plugin: 'maven'
dependencies {
compile name: 'android'
compile name: 'core'
compile name: 'gar-common'
compile name: 'obj-0.3.0'
}
sourceSets {
main {
java {
srcDirs = ['src/']
}
resources {
srcDirs = ['src/']
}
}
}
jar {
manifest {
attributes(
"Manifest-Version": "1.0",
"Gradle-Version": "$gradle.gradleVersion"
)
}
}
clean.doFirst {
delete "library/ar.jar"
}
import java.nio.file.Files
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
// Creates the pom file, but for now let's just use the template in the core folder
task createPom {
pom {
project {
groupId 'org.p5android'
artifactId 'processing-ar'
version '4.0.1'
packaging 'jar'
licenses {
license {
name 'GNU Lesser General Public License, version 2.1'
url 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt'
distribution 'repo'
}
}
}
}.writeTo("$buildDir/libs/ar.pom")
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
// Does not work because of Processing-specific tags in source code, such as @webref
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
// archives javadocJar
archives sourcesJar
}
jar.doLast { task ->
ant.checksum file: task.archivePath
}
task dist {
doLast {
File arJar = file("library/ar.jar");
//create intermediate folder if they don't exist
arJar.mkdirs();
// make copy of jar file to library folder
Files.copy(file("$buildDir/libs/ar.jar").toPath(),
arJar.toPath(), REPLACE_EXISTING);
}
}
dist.dependsOn build