-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.gradle
101 lines (86 loc) · 2.33 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
description = 'Free Java library for displaying plots'
allprojects {
group = 'de.erichseifert.gral'
version = getVersionString()
ext.inceptionYear = 2009
}
subprojects {
apply plugin: 'java'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
ext {
owner1_id = 'eseifert'
owner1_name = 'Erich Seifert'
owner1_email = 'dev[at]erichseifert.de'
owner2_id = 'mseifert'
owner2_name = 'Michael Seifert'
owner2_email = 'mseifert[at]error-reports.org'
website = 'https://github.com/eseifert/gral/'
}
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
runtime 'de.erichseifert.vectorgraphics2d:VectorGraphics2D:0.13'
}
apply plugin: 'license'
license {
header(rootProject.file('config/license-header.txt'))
strictCheck(true)
mapping {
java = 'SLASHSTAR_STYLE'
}
def currentYear = new GregorianCalendar().get(Calendar.YEAR)
ext.year = "${inceptionYear}-${currentYear}"
ext.owner1 = owner1_name
ext.email1 = owner1_email
ext.owner2 = owner2_name
ext.email2 = owner2_email
// Exlude certain file types from license checking
// https://github.com/hierynomus/license-gradle-plugin/issues/9
tasks.withType(nl.javadude.gradle.plugins.license.License).each { licenseTask ->
licenseTask.exclude '**.properties'
}
}
apply plugin: 'checkstyle'
checkstyle.configFile = new File("${rootDir}/config/checkstyle.xml")
apply plugin: 'pmd'
pmd {
// TODO: Dynamic dependency resolution possible?
toolVersion = '5.0.5'
ruleSets = ['java-basic']
ignoreFailures = true
}
task sourceJar(type: Jar) {
description = 'Assembles a jar archive containing the source code of the main classes.'
group = 'Build'
from sourceSets.main.allJava
classifier 'sources'
}
}
// Include the License Gradle plugin
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.15.+'
}
}
/*
* This method must not be named getVersion, because it would
* overwrite the implicit getter of the version property in the
* current Project object.
*/
def getVersionString() {
def out = new ByteArrayOutputStream()
exec {
commandLine('git', 'describe', '--tags', '--always')
standardOutput = out
}
return out.toString().trim()
}