-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
154 lines (135 loc) · 4.7 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
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.4.10'
id 'maven-publish'
id 'jacoco'
id 'de.undercouch.download' version '4.1.1'
}
group 'com.aquivalabs.force.ant'
version '0.13'
repositories {
mavenCentral()
}
def kotlin_version = '1.4.10'
def ant_version = '1.9.7'
def ant_salesforce_version = '47.0'
def xmlunit_version = '2.3.0'
dependencies {
implementation files("libs/ant-salesforce-${ant_salesforce_version}.jar")
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-html:0.7.3'
implementation "org.apache.ant:ant:$ant_version"
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testImplementation 'org.testng:testng:6.9.13.6'
testImplementation 'org.hamcrest:hamcrest-all:1.3'
testImplementation "org.xmlunit:xmlunit-core:$xmlunit_version"
testImplementation "org.xmlunit:xmlunit-matchers:$xmlunit_version"
testImplementation 'com.nhaarman:mockito-kotlin:0.12.2'
testImplementation 'org.jsoup:jsoup:1.10.1'
}
test {
useTestNG()
}
jacoco {
toolVersion = '0.8.5'
}
jacocoTestReport {
reports {
xml.enabled true
html.destination file("${buildDir}/jacocoHtml")
}
}
jar {
manifest {
attributes 'Implementation-Title': rootProject.name
attributes 'Implementation-Version': archiveVersion
attributes 'Ant-Version': "Apache Ant $ant_version"
attributes 'Created-By': System.getProperty('java.version') + ' (' + System.getProperty('java.vendor') + ')'
}
from('src/main/kotlin') {
include '**/antlib.xml'
}
}
task downloadAntSalesforce(type: Download) {
def archiveName = "salesforce_ant_${ant_salesforce_version}.zip"
def downloadedFile = file("$buildDir/downloads/$archiveName")
onlyIf {!downloadedFile.exists()}
src "https://gs0.salesforce.com/dwnld/SfdcAnt/$archiveName"
dest downloadedFile
overwrite false
}
task unzipAntSalesforce(dependsOn: downloadAntSalesforce, type: Copy) {
from zipTree(downloadAntSalesforce.dest)
into layout.buildDirectory.dir("downloads/unzipped-${ant_salesforce_version}")
}
task copyAntSalesforce(dependsOn: unzipAntSalesforce, type: Copy) {
from layout.buildDirectory.file("downloads/unzipped-${ant_salesforce_version}/ant-salesforce.jar")
into layout.projectDirectory.file('libs')
rename { String name -> "ant-salesforce-${ant_salesforce_version}.jar" }
}
compileKotlin.dependsOn.add(copyAntSalesforce)
task fatJar(type: Jar) {
manifest.from jar.manifest
archiveClassifier.set 'all'
from {
configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude 'META-INF/*.txt'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
exclude 'org/apache/tools/ant/'
exclude 'images/ant_logo_large.gif'
exclude 'kotlinx.html.shared/'
exclude 'kotlinx.html.shared.*.js'
}
with jar
}
task sourceJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier.set 'sources'
}
artifacts {
archives jar
archives fatJar
archives sourceJar
}
if (project.hasProperty('mavenRepositoryUsername') && project.hasProperty('mavenRepositoryPassword')) {
publishing {
repositories {
maven {
url = 'https://www.myget.org/F/aquiva-salesforce/maven'
credentials {
username = project.property('mavenRepositoryUsername')
password = project.property('mavenRepositoryPassword')
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar
pom {
name = 'antforce'
description = 'A set of Apache Ant tasks that help to implement Continuous Integration for Force.com projects. It\'s built on top of Force.com Migration Tool and extends it in many ways.'
url = 'https://github.com/valmaev/antforce'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'valmaev'
name = 'Vladimir Almaev'
}
}
scm {
url = 'https://github.com/valmaev/antforce'
}
}
}
}
}
}