-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
155 lines (132 loc) · 3.36 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
group = 'com.prezi.haxe'
if (hasProperty("release")) {
version = [ "git", "describe", "--match", "[0-9]*", "--dirty"].execute().text.trim()
} else {
version = [ "git", "describe", "--match", "[0-9]*", "--abbrev=0"].execute().text.trim() + "-SNAPSHOT"
}
task version {
doLast {
println "Version: ${version}"
}
}
def ossRelease = hasProperty("oss") || hasProperty("sonatype")
def signArtifacts = ossRelease || hasProperty("sign")
apply plugin: 'groovy'
apply plugin: "maven-publish"
apply plugin: 'idea'
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
tasks.withType(AbstractCompile) {
options.encoding = "UTF-8"
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation (
gradleApi(),
"org.webjars:requirejs:2.1.8",
"commons-io:commons-io:2.4",
"com.google.guava:guava:17.0",
// Required only for the incubating stuff brought over from Gradle 2.0
"commons-lang:commons-lang:2.6",
)
testImplementation (
'junit:junit:4.12',
"org.spockframework:spock-core:2.0-groovy-3.0",
// Override the one from Spock
"org.codehaus.groovy:groovy-all:3.0.7",
)
}
javadoc {
failOnError = false
}
task javadocJar(type: Jar) {
dependsOn javadoc
classifier = "javadoc"
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = "sources"
}
jar {
from "LICENSE.txt"
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
task run(type: Exec) {
dependsOn "install"
workingDir "src/test/at"
commandLine = ["gradle", "clean", "compile", "testJs", "uploadArchives", "--no-daemon", "-Pmunit.kill-browser", "--info", "--stacktrace"]
}
test {
useJUnitPlatform()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
url = "http://github.com/prezi/gradle-haxe-plugin"
name = project.name
description = project.description
scm {
url = "http://github.com/prezi/gradle-haxe-plugin"
connection = "scm:[email protected]:prezi/gradle-haxe-plugin.git"
developerConnection = "scm:[email protected]:prezi/gradle-haxe-plugin.git"
}
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 = "lptr"
name = "Lorant Pinter"
}
developer {
id = "Schipy"
name = "Peter Sipos"
}
developer {
id = "btorok"
name = "Balazs Torok"
}
}
}
}
}
repositories {
maven {
def isSnapshot = version.endsWith('SNAPSHOT')
if (ossRelease) {
credentials {
username = project.getProperty("sonatypeUsername")
password = project.getProperty("sonatypePassword")
}
url = isSnapshot ? "https://oss.sonatype.org/content/repositories/snapshots/" : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
} else if (project.hasProperty("nexusUser") && project.hasProperty("nexusPassword")) {
credentials {
username = project.getProperty("nexusUser")
password = project.getProperty("nexusPassword")
}
def baseRepoUrl = "https://artifactory.prezi.com/artifactory"
url = isSnapshot ? "${baseRepoUrl}/plugins-snapshot-local/" : "${baseRepoUrl}/plugins-release-local/"
}
}
}
}
if (signArtifacts) {
apply plugin: "signing"
signing {
sign publishing.publications.mavenJava
}
}