Skip to content

Commit 3376523

Browse files
committed
Fix: implementing support to 23.0.x
Signed-off-by: Kleber Rocha <[email protected]>
1 parent 55e5ec4 commit 3376523

File tree

3 files changed

+83
-30
lines changed

3 files changed

+83
-30
lines changed

build.gradle

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,37 @@
1515
*/
1616

1717
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+
}
1834

19-
apply from: 'plugin-common.gradle'
35+
pluginProject = project
2036

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]
2339

24-
version = project.fullVersion
25-
group = 'cd.go'
40+
licenseReport {
41+
excludes = [
42+
'com.squareup.okio:okio'
43+
]
44+
}
45+
}
2646

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)
3649

3750
repositories {
3851
jcenter()
@@ -59,18 +72,6 @@ dependencies {
5972
testImplementation group: 'junit', name: 'junit', version: '4.12'
6073
}
6174

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-
7475
tasks.withType(Jar) { jarTask ->
7576
preserveFileTimestamps = false
7677
reproducibleFileOrder = true
@@ -84,10 +85,10 @@ tasks.withType(Jar) { jarTask ->
8485

8586
manifest {
8687
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,
9192
'Source-Compatibility': project.sourceCompatibility,
9293
'Target-Compatibility': project.targetCompatibility
9394
)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Copyright 2023 klinux
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
id=cd.go.authorization.keycloak
18+
name=Keycloak oauth authorization plugin
19+
version=2.0.0-13
20+
goCdVersion=19.2.0
21+
description=Keycloak oauth authorization plugin for GoCD
22+
vendorName=klinux
23+
vendorUrl=https://github.com/klinux/gocd-keycloak-oauth-authorization-plugin
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!--
2+
~ Copyright 2023 klinux
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<go-plugin id="cd.go.authorization.keycloak" version="1">
18+
<about>
19+
<name>Keycloak oauth authorization plugin</name>
20+
<version>2.0.0-13</version>
21+
<target-go-version>19.2.0</target-go-version>
22+
<description>Keycloak oauth authorization plugin for GoCD</description>
23+
<vendor>
24+
<name>klinux</name>
25+
<url>https://github.com/klinux/gocd-keycloak-oauth-authorization-plugin</url>
26+
</vendor>
27+
28+
</about>
29+
</go-plugin>

0 commit comments

Comments
 (0)