-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
132 lines (115 loc) · 2.82 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
plugins {
id 'java-library'
id "eclipse"
id "maven-publish"
id 'org.cadixdev.licenser' version '0.6.1'
id "org.ajoberstar.grgit" version "4.1.1"
id "checkstyle"
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
def ENV = System.getenv()
def version_tag = 'dtklib_version'
def artifact_name = 'dtklib'
project.archivesBaseName = artifact_name
if (grgit == null) {
project.version = '99.0.0-nogit'
} else if (project.hasProperty(version_tag)) {
if (grgit.status().isClean()) {
project.version = project.getProperty(version_tag) + '.' + grgit.log().size()
} else {
project.version = project.getProperty(version_tag) + '.' + (grgit.log().size() + 1) + '-snapshot'
}
if (grgit.branch.current().name != 'main') {
artifact_name = artifact_name + '-' + grgit.branch.current().name
project.archivesBaseName = artifact_name
}
} else {
project.version = '99.0.0-local'
}
license {
header rootProject.file("HEADER")
include "**/*.java"
}
checkstyle {
configFile = rootProject.file("checkstyle.xml")
toolVersion = "8.44"
}
def eclipseName = artifact_name;
eclipse {
project {
name = eclipseName;
}
}
tasks.withType(JavaCompile) {
it.options.encoding = "UTF-8"
it.options.release = 17
}
jar {
from "LICENSE"
manifest
{
attributes "Implementation-Title": project.archivesBaseName
attributes "Implementation-Version": project.version
attributes "Maven-Artifact": "${group}:${project.archivesBaseName}:${project.version}"
attributes "Built-On-Java": "${System.getProperty("java.vm.version")} (${System.getProperty("java.vm.vendor")})"
}
}
java {
withSourcesJar()
}
sourceSets {
main {
java {
include '**/*'
exclude '*.DS_Store'
}
resources
{
include '**/*'
exclude '*.DS_Store'
}
}
test {
java {
exclude '**/*'
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = artifact_name
from components.java
pom {
licenses {
license {
name = 'GNU Lesser General Public License v3.0 or later'
url = 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html'
}
}
developers {
developer {
id = 'grondag'
name = 'grondag'
}
}
}
}
}
repositories {
mavenLocal()
maven {
url = 'sftp://maven.vram.io:22'
credentials {
if (project.hasProperty('maven_user')){
username = project.getProperty('maven_user')
}
if (project.hasProperty('maven_password')){
password = project.getProperty('maven_password')
}
}
}
}
}
apply from: 'dependencies.gradle'