forked from CadixDev/licenser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
154 lines (133 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
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
144
145
146
147
148
149
150
151
152
153
154
plugins {
id 'java-gradle-plugin'
id 'groovy'
id 'signing'
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.5.1'
id 'net.neoforged.gradleutils' version '3.0.0'
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
group = 'net.neoforged.licenser'
gradleutils {
version {
branches.suffixBranch()
}
setupSigning(signAllPublications: true)
}
println "Version: ${version = gradleutils.version}"
description = 'A simple license header manager for Gradle'
repositories {
gradlePluginPortal()
}
sourceSets {
functionalTest {
}
}
configurations {
functionalTestImplementation.extendsFrom(testImplementation)
functionalTestRuntimeOnly.extendsFrom(testRuntimeOnly)
}
gradlePlugin.testSourceSets(sourceSets.functionalTest)
tasks.register('functionalTest', Test) {
useJUnitPlatform()
description = 'Runs the functional tests.'
group = 'verification'
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
mustRunAfter test
// Gradle 8.10 wants to run on 17
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
}
}
dependencies {
implementation gradleApi()
testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0'
functionalTestImplementation gradleTestKit()
}
test {
useJUnitPlatform()
}
tasks.named('check') {
dependsOn(functionalTest)
}
license {
include '**/*.java'
include '**/*.groovy'
}
task sourceJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task groovydocJar(type: Jar, dependsOn: groovydoc) {
archiveClassifier = 'groovydoc'
from groovydoc.destinationDir
}
gradlePlugin {
plugins {
licenserPlugin {
id = 'net.neoforged.licenser'
implementationClass = 'org.cadixdev.gradle.licenser.Licenser'
}
}
}
publishing {
publications {
pluginMaven(MavenPublication) { mavenPublication ->
pom {
name = 'Licenser'
description = 'A simple license header manager for Gradle, originally from CadixDev'
url = 'https://github.com/neoforged/licenser'
scm {
url = 'https://github.com/neoforged/licenser'
connection = 'https://github.com/neoforged/licenser.git'
developerConnection = 'scm:git:[email protected]:NeoForged/licenser.git'
}
issueManagement {
system = 'github'
url = 'https://github.com/neoforged/licenser/issues'
}
organization {
name = 'NeoForged'
url = 'https://github.com/neoforged'
}
licenses {
license {
name = 'MIT'
url = file("LICENSE").getAbsolutePath()
}
}
}
}
}
repositories {
maven {
name 'forge'
if (System.env.MAVEN_USER && System.env.MAVEN_PASSWORD) {
def publishingEndpoint = System.env.MAVEN_URL_RELEASE ?: 'https://maven.neoforged.net/releases'
if (project.version.toString().endsWith("-SNAPSHOT") && System.env.MAVEN_URL_SNAPSHOTS) {
url System.env.MAVEN_URL_SNAPSHOTS
} else {
url publishingEndpoint
}
authentication {
basic(BasicAuthentication)
}
credentials {
username = System.env.MAVEN_USER
password = System.env.MAVEN_PASSWORD
}
} else {
url 'repo'
}
}
}
}
changelog {
from '0.7'
disableAutomaticPublicationRegistration()
}