-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
110 lines (93 loc) · 3.92 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.asciidoctor:asciidoctorj:${asciidoctorjVersion}"
//classpath "org.asciidoctor:asciidoctorj-diagram:${asciidoctorjDiagramVersion}"
}
}
plugins {
id 'org.asciidoctor.jvm.convert' version '2.2.0'
id 'com.jfrog.bintray' version '1.8.4'
id 'de.undercouch.download' version '4.0.1'
}
buildScan {
if (System.getenv('CI')) {
publishAlways()
tag 'CI'
}
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
rootProject.ext.signJPackageImages = signJPackageImages == "true" // create boolean in ext from property string
logger.warn "rootProject.ext.signJPackageImages = ${rootProject.ext.signJPackageImages}"
allprojects {
apply plugin: 'java'
version = walletFrameworkVersion // set in gradle.properties
group = 'org.consensusj.wallet'
repositories {
jcenter()
//mavenLocal() // Uncomment to work with local snapshots
maven { url 'https://dl.bintray.com/consensusj/maven' }
maven { url 'https://dl.bintray.com/msgilligan/maven' } // ConsensusJ (bitcoinj DSL)
maven { url 'https://dl.bintray.com/omni/maven' } // OmniJ (RPC client)
maven { url 'https://oss.sonatype.org/content/groups/public' }
maven { url 'https://jitpack.io' }
}
}
subprojects {
apply plugin: 'groovy'
/*
* Wallet-Framework will target recent JDK versions. For now library modules will
* target JDK 11 and sample apps will be built using JDK 14.
* We want to focus on jpackage'd apps and these should always use recent JDK.
*/
sourceCompatibility = 11
targetCompatibility = 11
dependencies {
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
testImplementation "org.codehaus.groovy:groovy:${groovyVersion}:"
testImplementation("org.spockframework:spock-core:${spockVersion}") {
exclude module: "groovy-all"
}
testRuntimeOnly "net.bytebuddy:byte-buddy:1.8.21" // allows Spock to mock classes (in addition to interfaces)
testRuntimeOnly "org.objenesis:objenesis:2.6" // Allow Spock to mock classes with constructor arguments
testRuntimeOnly "org.slf4j:slf4j-jdk14:${slf4jVersion}" // Runtime implementation of slf4j
}
compileJava {
options.compilerArgs << '-Xlint:deprecation' << '-Xlint:unchecked'
}
}
apply from: 'gradle/bintray.gradle'
apply from: 'gradle/downloadJPackage.gradle'
task testReport(type: TestReport) {
destinationDir = file("$buildDir/reports/allTests")
// Include the results from the `test` task in all subprojects
reportOn subprojects*.test
}
build.dependsOn subprojects.build
task buildCI(dependsOn: [build, 'consensusj-netwallet-fx:jlink', 'consensusj-signwallet-fx:jlink'])
task buildJPackages(dependsOn: [buildCI, 'consensusj-netwallet-fx:jpackage', 'consensusj-signwallet-fx:jpackage'])
/**
* Massage the version string based upon the current OS to be valid
* for the installer platforms for that OS. rpmbuild, MSI, and potentially
* others have restrictions on valid version strings.
*
* @param appVersion A typical Gradle version string
* @return a version string that should work for the currrent platform
*/
String normalizeAppVersion(final String appVersion) {
def os = org.gradle.internal.os.OperatingSystem.current()
if (os.linux) {
// Replace '-' with '.' for rpmbuild
return appVersion.replace('-', '.')
} else if (os.windows) {
// This is a hack attempt to assure the version conforms to MSI productVersion string rules
// See https://docs.microsoft.com/en-us/windows/win32/msi/productversion
// For now, we'll just remove '-SNAPSHOT' if present.
return appVersion.replaceAll('-SNAPSHOT$', '')
} else {
return appVersion
}
}