-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
94 lines (81 loc) · 2.67 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
plugins {
id "com.gradle.plugin-publish" version "0.15.0"
id "java-gradle-plugin"
// Apply other plugins here, e.g. the kotlin plugin for a plugin written in Kotlin
// or the groovy plugin if the plugin uses Groovy
}
apply plugin: 'java-gradle-plugin'
apply plugin: JavaPlugin
group='com.github.harbby'
version='1.1.9'
sourceCompatibility = 17
targetCompatibility = 17
if(project.hasProperty('target')) {
apply from: "${project.target}.gradle"
}
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation gradleTestKit()
}
/*
* Make sure our DSL helper file makes it into the jar for IDE auto-complete
*/
task stageGroovyDSL(type: Copy) {
from(sourceSets.main.allSource) {
include '**/*.gdsl'
}
into sourceSets.main.output.classesDirs.asPath
}
jar.dependsOn stageGroovyDSL
validatePlugins.dependsOn stageGroovyDSL
pluginUnderTestMetadata.dependsOn stageGroovyDSL
javadoc.dependsOn stageGroovyDSL
tasks.named("processResources") {
duplicatesStrategy = 'include'
}
tasks.withType(org.gradle.jvm.tasks.Jar) { duplicatesStrategy = 'include' }
/*---------- publishing gradle plugin--------*/
// First, apply the publishing plugin
//plugins {
// id "com.gradle.plugin-publish" version "0.15.0"
// id "java-gradle-plugin"
// // Apply other plugins here, e.g. the kotlin plugin for a plugin written in Kotlin
// // or the groovy plugin if the plugin uses Groovy
//}
// If your plugin has any external java dependencies, Gradle will attempt to
// download them from JCenter for anyone using the plugins DSL
// so you should probably use JCenter for dependency resolution in your own
// project.
repositories {
mavenCentral()
}
// Use java-gradle-plugin to generate plugin descriptors and specify plugin ids
// Use ./gradlew clean assemble publishPlugins
gradlePlugin {
plugins {
greetingsPlugin {
id = 'com.github.harbby.gradle.serviceloader'
implementationClass = 'com.github.harbby.gradle.plugins.serviceloader.ServiceLoaderPlugin'
}
}
}
// The configuration example below shows the minimum required properties
// configured to publish your plugin to the plugin portal
pluginBundle {
website = 'https://github.com/harbby/gradle-serviceloader'
vcsUrl = 'https://github.com/harbby/gradle-serviceloader'
description = 'this is java serviceloader plugin' +
'\n\n' +
'\tUsage:\n' +
'\t\tserviceLoader {\n' +
'\t\t\t serviceInterface \'ideal.sylph.spi.Runner\'\n' +
'\t\t\t serviceInterface \'ideal.sylph.api.PipelinePlugin\'\n' +
'\t\t}'
tags = ['java_spi', 'serviceloader']
plugins {
greetingsPlugin {
// id is captured from java-gradle-plugin configuration
displayName = 'Gradle serviceloader plugin'
}
}
}