15
15
*/
16
16
17
17
apply plugin : ' java'
18
+ apply from : " https://raw.githubusercontent.com/gocd/gocd-plugin-gradle-task-helpers/master/helper.gradle?_=${ (int) (new Date().toInstant().epochSecond / 60)} "
19
+
20
+ gocdPlugin {
21
+ id = ' cd.go.authorization.keycloak'
22
+ pluginVersion = ' 2.0.0'
23
+ goCdVersion = ' 19.2.0'
24
+ name = ' Keycloak oauth authorization plugin'
25
+ description = ' Keycloak oauth authorization plugin for GoCD'
26
+ vendorName = ' klinux'
27
+ vendorUrl = ' https://github.com/klinux/gocd-keycloak-oauth-authorization-plugin'
28
+
29
+ githubRepo {
30
+ owner = System . getenv(' GITHUB_USER' ) ?: ' klinux'
31
+ repo = ' gocd-keycloak-oauth-authorization-plugin'
32
+ token = System . getenv(' GITHUB_TOKEN' ) ?: ' bad-token'
33
+ }
18
34
19
- apply from : ' plugin-common.gradle '
35
+ pluginProject = project
20
36
21
- project . ext . pluginVersion = ' 2.0.0 '
22
- project . ext . fullVersion = project . distVersion ? " ${ project.pluginVersion } - ${ project.distVersion } " : project. pluginVersion
37
+ prerelease = ! " No " . equalsIgnoreCase( System . getenv( ' PRERELEASE ' ))
38
+ assetsToRelease = [ project. tasks . jar]
23
39
24
- version = project. fullVersion
25
- group = ' cd.go'
40
+ licenseReport {
41
+ excludes = [
42
+ ' com.squareup.okio:okio'
43
+ ]
44
+ }
45
+ }
26
46
27
- project. ext. pluginDesc = [
28
- id : ' cd.go.authorization.keycloak' ,
29
- version : project. fullVersion,
30
- goCdVersion : ' 19.2.0' ,
31
- name : ' Keycloak oauth authorization plugin' ,
32
- description : ' Keycloak oauth authorization plugin for GoCD' ,
33
- vendorName : ' klinux' ,
34
- vendorUrl : ' https://github.com/klinux/gocd-keycloak-oauth-authorization-plugin'
35
- ]
47
+ group = ' cd.go'
48
+ version = gocdPlugin. fullVersion(project)
36
49
37
50
repositories {
38
51
jcenter()
@@ -59,18 +72,6 @@ dependencies {
59
72
testImplementation group : ' junit' , name : ' junit' , version : ' 4.12'
60
73
}
61
74
62
- processResources {
63
- from(" src/main/resource-templates" ) {
64
- filesMatching(' plugin.xml' ) {
65
- expand project. pluginDesc
66
- }
67
-
68
- filesMatching(' plugin.properties' ) {
69
- expand project. pluginDesc
70
- }
71
- }
72
- }
73
-
74
75
tasks. withType(Jar ) { jarTask ->
75
76
preserveFileTimestamps = false
76
77
reproducibleFileOrder = true
@@ -84,10 +85,10 @@ tasks.withType(Jar) { jarTask ->
84
85
85
86
manifest {
86
87
attributes(
87
- ' Go-Version' : project. pluginDesc . goCdVersion,
88
- ' Plugin-Revision' : project. pluginDesc . version ,
89
- ' Implementation-Title' : project. name,
90
- ' Implementation-Version' : project. version ,
88
+ ' Go-Version' : project. gocdPlugin . goCdVersion,
89
+ ' Plugin-Revision' : project. gocdPlugin . pluginVersion ,
90
+ ' Implementation-Title' : project. gocdPlugin . name,
91
+ ' Implementation-Version' : project. gocdPlugin . pluginVersion ,
91
92
' Source-Compatibility' : project. sourceCompatibility,
92
93
' Target-Compatibility' : project. targetCompatibility
93
94
)
0 commit comments