forked from CadixDev/licenser
/
build.gradle
103 lines (84 loc) · 2.42 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
plugins {
id 'java-gradle-plugin'
id 'groovy'
id 'maven-publish'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'net.minecraftforge.licenser'
id 'net.minecraftforge.gradleutils' version '2.3.3'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group = 'net.minecraftforge'
version gradleutils.tagOffsetVersion
println "Version: $version"
repositories {
gradlePluginPortal()
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(8)
withSourcesJar()
}
tasks.withType(GroovyCompile).configureEach {
groovyOptions.optimizationOptions.indy = true
}
sourceSets {
functionalTest
}
configurations {
functionalTestImplementation.extendsFrom(testImplementation)
functionalTestRuntimeOnly.extendsFrom(testRuntimeOnly)
}
gradlePlugin.testSourceSets(sourceSets.functionalTest)
tasks.register('functionalTest', Test) {
description = 'Runs the functional tests.'
group = 'verification'
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
mustRunAfter test
}
dependencies {
testImplementation gradleTestKit()
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0'
functionalTestImplementation gradleTestKit()
}
test {
useJUnit()
}
license {
include '**/*.java'
include '**/*.groovy'
}
gradlePlugin {
website = 'https://github.com/MinecraftForge/licenser'
vcsUrl = 'https://github.com/MinecraftForge/licenser.git'
plugins {
licenser {
id = 'net.minecraftforge.licenser'
implementationClass = 'net.minecraftforge.licenser.Licenser'
displayName = 'Forge Licenser'
description = 'A simple license header manager for Gradle - Fork of org.cadixdev.licenser'
tags = ['license']
}
}
}
jar {
archiveClassifier = 'thin'
}
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
enableRelocation true
archiveClassifier = null
relocationPrefix = 'net.minecraftforge.licenser.shadow'
relocate 'org.cadixdev.gradle.licenser', 'net.minecraftforge.licenser'
}
publishing {
publications.register('pluginMaven', MavenPublication) {
pom {
artifactId = 'licenser'
}
}
repositories {
maven {
url = 'file://' + file('build/repo').absolutePath
}
}
}