-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
141 lines (112 loc) · 3.96 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
plugins {
id 'groovy'
id 'java-gradle-plugin'
id 'maven-publish'
id 'idea'
id "org.jetbrains.gradle.plugin.idea-ext" version "0.5"
id 'com.gradle.build-scan' version '2.3'
id 'com.github.hierynomus.license-base' version '0.15.0'
}
group = 'com.lingocoder'
version = '0.5.2'
description = 'A Gradle plugin that executes Java Jar files'
apply from: 'gradle/sourcesets/custom.sourcesets.gradle'
gradlePlugin {
plugins {
jarexecPlugin {
id = 'com.lingocoder.jarexec'
implementationClass = 'com.lingocoder.plugin.jarexec.JarExecPlugin'
}
}
testSourceSets sourceSets.test, sourceSets.functionalTest, sourceSets.integrationTest
}
repositories{
mavenLocal()
jcenter()
mavenCentral()
}
dependencies{
/* JDK 9+ sources may have dependencies on JDK 8- sources in the same project. */
/* This next line configures that dependency. This way, we avoid recompiling the */
/* JDK 8- soures if it's not necessary. */
java9Implementation files(sourceSets.main.output.classesDirs) { builtBy compileJava }
java11Implementation files(sourceSets.main.output.classesDirs) { builtBy compileJava }
/* The java-gradle-plugin apparently configures the gradle API dependencies only for the */
/* default main source set. This next line is needed to explictly set it for JDK 9+ compilation. */
java9Implementation gradleApi()
java11Implementation gradleApi()
java9Implementation group: 'com.lingocoder', name: 'lingocoder.core', version: '0.5.2'
java11Implementation group: 'com.lingocoder', name: 'lingocoder.core', version: '0.5.2'
implementation group: 'com.lingocoder', name: 'lingocoder.core', version: '0.5.2'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.3.0-alpha4'
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'org.codehaus.groovy', name: 'groovy', version: '3.0.0-alpha-4'
testImplementation(group: 'org.spockframework', name: 'spock-core', version: '1.3-groovy-2.5') {
exclude module: 'org.codehaus.groovy'
}
testRuntimeOnly group: 'org.raml.jaxrs', name: 'raml-to-jaxrs-cli', classifier: 'jar-with-dependencies', version: '3.0.5'
}
compileJava {
sourceCompatibility = 8
targetCompatibility = 8
}
compileJava9Java {
sourceCompatibility = 9
targetCompatibility = 9
}
compileJava11Java {
sourceCompatibility = 11
targetCompatibility = 11
}
ext.moduleName = 'com.lingocoder.jarexec'
jar {
into('META-INF/versions/9') {
from sourceSets.java9.output
}
into('META-INF/versions/11') {
from sourceSets.java11.output
}
inputs.property("moduleName", moduleName)
manifest.attributes(
'Multi-Release': 'true',
'Automatic-Module-Name': moduleName
)
}
publishing {
repositories {
maven {
url '../consuming/maven-repo'
}
ivy {
url '../consuming/ivy-repo'
}
}
}
task fixIdeaPluginClasspath {
doFirst {
configure(tasks.pluginUnderTestMetadata) {
def ideaClassesPath = project.buildDir.toPath().resolveSibling("out").resolve("production")
def newClasspath = pluginClasspath as List
newClasspath.add(0, ideaClassesPath)
pluginClasspath.setFrom(newClasspath)
}
}
}
pluginUnderTestMetadata.mustRunAfter(fixIdeaPluginClasspath)
idea.project.settings {
taskTriggers {
beforeBuild fixIdeaPluginClasspath, pluginUnderTestMetadata
}
}
license { header = file('src/main/resources/META-INF/LICENSE-HEADER.txt') }
license {
excludes(["**/*.txt", "**/*keep*.*", "**/*.gradle*", "**/*.*ignore", "**/*.properties"])
ext.year = Calendar.getInstance().get(Calendar.YEAR)
ext.name = 'lingocoder'
ext.email = '[email protected]'
skipExistingHeaders = true
}
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}