-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
107 lines (88 loc) · 2.45 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
plugins {
id 'java'
id 'maven'
id 'eclipse'
id 'idea'
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.8.1'
id 'com.github.johnrengelman.shadow' version '2.0.1'
id 'edu.sc.seis.launch4j' version '2.4.1'
id 'org.scm4j.releaser.scm4j-releaser-gradle-plugin' version '0.2.0'
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
group = 'org.scm4j'
ext.mainClass = 'org.scm4j.installer.Installer'
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
configurations {
shadowRuntime
}
dependencies {
def swtPostfix = (currentOS.windows ? 'win32.win32' : (currentOS.linux ? 'gtk.linux'
: (currentOS.macOsX ? 'cocoa.macosx' : 'unknown'))) + '.x86' + (is64bit() ? '_64' : '')
compileOnly "org.eclipse.swt:org.eclipse.swt.$swtPostfix:4.3"
runtimeOnly "org.eclipse.swt:org.eclipse.swt.$swtPostfix:4.3"
shadowRuntime 'org.eclipse.swt:org.eclipse.swt.win32.win32.x86:4.3'
compile 'ch.qos.logback:logback-classic:1.2.3'
compile 'commons-cli:commons-cli:1.4'
testCompile 'junit:junit:4.12'
}
configurations.compile {
resolutionStrategy {
cacheDynamicVersionsFor 0, 'seconds'
cacheChangingModulesFor 0, 'seconds'
}
}
test {
testLogging {
events "failed"
exceptionFormat "full"
}
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
jar {
manifest.attributes (
'Specification-Title': project.name,
'Specification-Version': version.replaceAll(/-SNAPSHOT$/, ''),
'Implementation-Title': project.name,
'Implementation-Version': "$version (${new Date().format('yyyy-MM-dd')})",
'Main-Class': mainClass,
)
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
archives file: file("$buildDir/launch4j/${project.name}.exe"), builtBy: createExe
}
static def getCurrentOS() {
return org.gradle.internal.os.OperatingSystem.current()
}
static def is64bit() {
return System.getProperty('os.arch').contains('64')
}
shadowJar {
configurations = [project.configurations.compile, project.configurations.shadowRuntime]
}
createExe {
mainClassName = mainClass
bundledJrePath = '../jre-1.8.0_171'
jreRuntimeBits = '32'
copyConfigurable = project.tasks.shadowJar.outputs.files
jar = "lib/${project.tasks.shadowJar.archiveName}"
}