-
Notifications
You must be signed in to change notification settings - Fork 55
/
build.gradle
143 lines (116 loc) · 3.6 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
133
134
135
136
137
138
139
140
141
142
143
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
buildscript {
dependencies {
classpath ('org.eclipse.jgit:org.eclipse.jgit:') {
version {
strictly '5.13.3.202401111512-r'
}
}
}
}
plugins {
id 'groovy'
id 'maven-publish'
id 'java-gradle-plugin'
id "com.gradle.plugin-publish" version "0.14.0"
id "com.github.johnrengelman.shadow" version "7.0.0"
id "com.gorylenko.gradle-git-properties" version "2.3.2"
}
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
apply plugin: "com.gradle.plugin-publish"
repositories {
mavenCentral()
maven {
name = 'ajoberstar-backup'
url = 'https://ajoberstar.org/bintray-backup/'
}
// for debugging
//maven {
// url 'https://repo.gradle.org/gradle/libs-releases-local/'
//}
}
def integrationTest = sourceSets.create("integrationTest")
dependencies {
shadow gradleApi()
shadow localGroovy()
implementation('org.ajoberstar.grgit:grgit-core:4.1.1') {
exclude(group: 'org.slf4j')
}
// for debugging
//implementation 'org.gradle:gradle-language-jvm:5.6.2'
//implementation 'org.gradle:gradle-language-java:5.6.2'
testImplementation 'junit:junit:4.12'
testImplementation gradleTestKit()
integrationTestImplementation 'junit:junit:4.12'
integrationTestImplementation gradleTestKit()
integrationTestImplementation project
integrationTestImplementation sourceSets.test.output // Include test files for git project utils
}
task relocateShadowJar(type: ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = "gradlegitproperties"
}
tasks.shadowJar.dependsOn tasks.relocateShadowJar
shadowJar {
archiveClassifier.set('')
}
tasks.shadowJar.dependsOn tasks.jar
components.java.withVariantsFromConfiguration(configurations.runtimeElements) {
skip()
}
version = "2.4.2"
group = "com.gorylenko.gradle-git-properties"
gitProperties {
keys = ['git.branch','git.commit.id','git.commit.time']
dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
dateFormatTimeZone = "PST"
}
tasks.withType(GroovyCompile) {
targetCompatibility = JavaVersion.VERSION_1_8
}
test {
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
tasks.register("integrationTest", Test) {
dependsOn tasks.shadowJar
description = 'Runs the integration tests.'
group = "verification"
testClassesDirs = integrationTest.output.classesDirs
classpath = integrationTest.runtimeClasspath
it.systemProperty "integration.plugin.path", tasks.shadowJar.outputs.getFiles().asPath // Pass java system property indicating integration plugin path
}
tasks.register("sourceJar", Jar) {
classifier = "sources"
from sourceSets.main.resources, sourceSets.main.groovy
dependsOn tasks.named("classes")
}
publishing {
publications {
pluginJar(MavenPublication) { publication ->
from project.shadow.component(publication)
artifact sourceJar
}
}
// for testing: ./gradlew clean publishToMavenLocal
repositories {
mavenLocal()
}
}
pluginBundle {
website = 'http://github.com/n0mer/gradle-git-properties'
vcsUrl = 'https://github.com/n0mer/gradle-git-properties'
description = 'Produce git.properties for spring-boot-actuator'
tags = ['git', 'spring-boot']
plugins {
gitPropertiesPlugin {
id = 'com.gorylenko.gradle-git-properties'
displayName = 'Gradle Git Properties plugin'
}
}
}