-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
112 lines (95 loc) · 3.04 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
import java.text.SimpleDateFormat
import com.github.spotbugs.snom.Effort
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.PropertiesConfiguration
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'gradle.plugin.com.github.johnrengelman:shadow:8.0.0'
classpath 'commons-configuration:commons-configuration:1.10'
classpath 'com.guardsquare:proguard-gradle:7.6.1'
classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:6.1.3'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:6.0.1.5171'
}
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'idea'
apply plugin: 'com.github.spotbugs'
apply plugin: 'jacoco'
apply plugin: 'org.sonarqube'
tasks.withType(JavaCompile) {
options.release = 9
}
ext {
privkeyid = '99'
privkeyfile = "$rootDir/config/priv_key"
pubkeyfile = "$rootDir/config/pub_key"
mxtfile = project.layout.buildDirectory.dir("${rootProject.name}-v${getConfigValueForKey("module_build")}.mxt")
outjar = project.layout.buildDirectory.dir("proguard-${rootProject.name}-v${getConfigValueForKey("module_build")}.jar")
}
repositories {
mavenCentral()
flatDir dirs: "$rootDir/lib"
}
spotbugs {
effort = Effort.valueOf('MAX')
excludeFilter = file("$rootDir/config/spotbugs-exclude.xml")
}
spotbugsMain {
reports {
html {
required = true
}
}
}
jacoco {
toolVersion = "0.8.12"
}
tasks.withType(Checkstyle) {
reports {
xml.required = false
html.required = true
html.stylesheet resources.text.fromFile("$rootDir/config/checkstyle/checkstyle-noframes-sorted.xsl")
}
}
checkstyle {
toolVersion = "10.21.2"
}
pmd {
toolVersion = "7.4.0"
sourceSets = [sourceSets.main]
ruleSets = []
ruleSetFiles = files("$rootDir/config/pmd-ruleSet.xml")
}
sonar {
properties {
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.organization", "my-flow"
}
}
}
task createLibs(type: Exec) {
description 'Generates patched libraries from trusted source'
executable "sh"
args "-c", "scripts/create_libs.sh"
}
String getCurrentTimestamp() {
Date today = new Date()
SimpleDateFormat df = new SimpleDateFormat('yyyy-MM-dd HH:mm:ss')
return df.format(today)
}
String getConfigValueForKey(String key) {
file("${project(':core').projectDir}/src/main/resources/com/moneydance/modules/features/paypalimporter/meta_info.dict").withInputStream {
final Configuration config = new PropertiesConfiguration();
config.load(it);
return config.getString("\"" + key + "\"").replaceAll("^\"|\"\$", "");
}
}