Skip to content

Commit 0c0e239

Browse files
committed
🎨(gradle) 换用tasks.register
1 parent 1537372 commit 0c0e239

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ repositories {
4040

4141
//ScriptAgent
4242
if (!inChina) {
43-
maven("https://maven.tinylake.tech/") //cloudFlare mirror
43+
maven("https://maven.tinylake.top/") //cloudFlare mirror
4444
} else {
4545
maven {
4646
url = uri("https://packages.aliyun.com/maven/repository/2102713-release-0NVzQH/")
@@ -167,7 +167,7 @@ tasks {
167167
named<Delete>("clean") {
168168
delete(files("scripts/cache"))
169169
}
170-
create<Zip>("scriptsZip") {
170+
register<Zip>("scriptsZip") {
171171
group = "plugin"
172172
from("scripts") {
173173
include("bootStrap/**")
@@ -183,7 +183,7 @@ tasks {
183183
println(archiveFile.get())
184184
}
185185
}
186-
val buildPlugin = create<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("buildPlugin") {
186+
val buildPlugin by registering(com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar::class) {
187187
group = "plugin"
188188
dependsOn("scriptsZip")
189189
from(sourceSets.getByName("plugin").output)
@@ -203,10 +203,10 @@ tasks {
203203
}
204204
val destPrecompile = layout.buildDirectory.dir("tmp/scripts")
205205
val destBuiltin = layout.buildDirectory.dir("tmp/builtinScripts")
206-
val precompile = create<JavaExec>("precompile") {
206+
val precompile = register<JavaExec>("precompile") {
207207
dependsOn(buildPlugin)
208208
group = "plugin"
209-
classpath(buildPlugin.outputs.files)
209+
classpath(buildPlugin.map { it.outputs.files })
210210
systemProperties["ScriptAgent.PreparePack"] = "true"
211211
environment("SAMain", "bootStrap/generate")
212212

@@ -217,7 +217,7 @@ tasks {
217217
destBuiltin.get().asFile.deleteRecursively()
218218
}
219219
}
220-
val precompileZip = create<Zip>("precompileZip") {
220+
val precompileZip = register<Zip>("precompileZip") {
221221
dependsOn(precompile)
222222
group = "plugin"
223223
archiveClassifier.set("precompile")
@@ -228,13 +228,13 @@ tasks {
228228
}
229229
}
230230

231-
create<Jar>("allInOneJar") {
231+
register<Jar>("allInOneJar") {
232232
dependsOn(buildPlugin, precompileZip)
233233
group = "plugin"
234234
archiveClassifier.set("allInOne")
235235
includeEmptyDirs = false
236236

237-
from(zipTree(buildPlugin.outputs.files.singleFile))
237+
from(buildPlugin.map { zipTree(it.outputs.files.singleFile) })
238238
from(destBuiltin) {
239239
into("builtin")
240240
}

0 commit comments

Comments
 (0)