Skip to content

Commit 0db96f0

Browse files
committed
Fix the mess that is my gradle file :)
1 parent 8ebd09f commit 0db96f0

File tree

2 files changed

+34
-32
lines changed

2 files changed

+34
-32
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+
import de.dosmike.sponge.pluginpublisher.gradle.NotifyDiscordBotTask
3+
import de.dosmike.sponge.pluginpublisher.gradle.PublishToGitTask
4+
import de.dosmike.sponge.pluginpublisher.gradle.PublishToOreTask
25
import de.dosmike.sponge.pluginpublisher.tasks.DiscordBotConfiguration
36
import de.dosmike.sponge.pluginpublisher.tasks.GitConfiguration
47
import de.dosmike.sponge.pluginpublisher.tasks.OreConfiguration
@@ -10,7 +13,7 @@ plugins {
1013
id 'idea'
1114
id 'org.spongepowered.plugin' version '0.9.0'
1215
id 'com.github.johnrengelman.shadow' version '5.1.0'
13-
id 'com.github.dosmike.PluginPublisher' version '1.2.1'
16+
id 'com.github.dosmike.PluginPublisher' version '1.2.2'
1417
}
1518
group = 'com.github.dosmike'
1619

@@ -130,50 +133,49 @@ task zReleaseZip(type: Zip, group:'_Plugin', dependsOn: uberJar) {
130133
into 'mods'
131134
}
132135
}
133-
134-
task zPublish(group:'_Plugin', dependsOn:zReleaseZip) {
136+
task z_Publish(group:'_Plugin', dependsOn:zReleaseZip) {
135137
def keyfile = file('..\\PluginPublisher\\.apikeys')
136138
onlyIf { keyfile.exists() }
139+
outputs.upToDateWhen {false}
137140
def props, versionDesc
138141
doFirst {
139142
props = new Properties()
140143
file('..\\PluginPublisher\\.apikeys').withInputStream {
141144
props.load(it)
142145
}
143146
//show an input prompt
144-
versionDesc = TaskFunctors.validateReleaseDescription(null, false);
145-
}
146-
doLast {
147-
TaskFunctors.runGitTask(new GitConfiguration(
148-
apiKey: props.getProperty('gitkey'),
149-
slug: 'DosMike/VillagerShops',
150-
tag: version,
151-
tagFull: "Release Build ${version}",
152-
assets: zReleaseZip.outputs.files,
153-
description: versionDesc
154-
), { -> files(it).files } )
147+
versionDesc = TaskFunctors.validateReleaseDescription(null, false)
155148
}
156-
157149
doLast {
158-
TaskFunctors.runOreTask(new OreConfiguration(
159-
apiKey: props.getProperty('orekey'),
160-
project: 'DosMike/VillagerShops',
161-
asset: uberJar.outputs.files,
162-
description: versionDesc
163-
), { -> files(it).files } )
164-
}
150+
project.zPub_Git.apiKey.set ( props.getProperty('gitkey') )
151+
project.zPub_Ore.apiKey.set ( props.getProperty('orekey') )
152+
project.zPub_Discord.apiKey.set( props.getProperty('discordkey') )
165153

166-
doLast {
167-
TaskFunctors.runDiscordTask(new DiscordBotConfiguration(
168-
apiKey: props.getProperty('discordkey'),
169-
server: '342942444288999435',
170-
channel: '352760019873169408',
171-
header: "<@&644225680833249320> Version ${version} released on Ore and GitHub",
172-
description: versionDesc
173-
))
174-
TaskFunctors.terminateJDA()
154+
project.zPub_Git.messageBody.set ( versionDesc )
155+
project.zPub_Ore.messageBody.set ( versionDesc )
156+
project.zPub_Discord.messageBody.set( versionDesc )
175157
}
176158
}
159+
task zPub_Git(type: PublishToGitTask, group:'_Plugin', dependsOn: z_Publish) {
160+
gitSlug.set ( 'DosMike/VillagerShops' )
161+
versionTag.set ( project.version.toString() )
162+
versionName.set ( "Release Build ${project.version}" )
163+
uploadAssets.set( zReleaseZip.outputs.files )
164+
}
165+
task zPub_Ore(type: PublishToOreTask, group:'_Plugin', dependsOn: z_Publish) {
166+
projectId.set ( pluginid.toString() )
167+
channel.set ( 'Release' )
168+
uploadAsset.set( jar.outputs.files )
169+
}
170+
task zPub_Discord(type: NotifyDiscordBotTask, group:'_Plugin', dependsOn: z_Publish) {
171+
guildId.set ( '342942444288999435' )
172+
channelId.set ( '773123356722462752' )
173+
messageHeader.set( "<@&794978576256335883> Version ${version} released on Ore and GitHub" )
174+
finalizedBy(TerminateDiscordBot)
175+
}
176+
z_Publish.finalizedBy(zPub_Git)
177+
zPub_Git.finalizedBy(zPub_Ore)
178+
zPub_Ore.finalizedBy(zPub_Discord)
177179

178180
//for generating the jar
179181
jar {

0 commit comments

Comments
 (0)