Skip to content

Commit c85f60a

Browse files
committed
[2.0.7] 修复一些问题
1 parent 3527189 commit c85f60a

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group = "io.izzel.taboolib"
11-
version = "2.0.6"
11+
version = "2.0.7"
1212

1313
configurations {
1414
create("embed") {

src/main/groovy/io/izzel/taboolib/gradle/TabooLibPlugin.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class TabooLibPlugin implements Plugin<Project> {
8080
}
8181

8282
def kotlinVersion = KotlinPluginWrapperKt.getKotlinPluginVersion(project).replaceAll("[._-]", "")
83-
def coroutinesVersion = tabooExt.version.coroutines.replaceAll("[._-]", "")
8483

8584
def jarTask = project.tasks.jar as Jar
8685
tabooTask.configure { TabooLibMainTask task ->
@@ -98,7 +97,10 @@ class TabooLibPlugin implements Plugin<Project> {
9897
}
9998
if (!tabooExt.version.isSkipKotlinRelocate()) {
10099
task.relocations['kotlin.'] = 'kotlin' + kotlinVersion + '.'
101-
task.relocations['kotlinx.coroutines.'] = 'kotlinx.coroutines' + coroutinesVersion + '.'
100+
if (tabooExt.version.coroutines != null) {
101+
def coroutinesVersion = tabooExt.version.coroutines.replaceAll("[._-]", "")
102+
task.relocations['kotlinx.coroutines.'] = 'kotlinx.coroutines' + coroutinesVersion + '.'
103+
}
102104
}
103105
}
104106
}

src/main/groovy/io/izzel/taboolib/gradle/description/BuilderVelocity.groovy

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ class BuilderVelocity extends Builder {
2424
def con = description.con.contributors.collect { it.name }
2525
writeList(info, con, 'authors')
2626
// dependencies
27-
def dependencies = new JsonArray()
28-
description.dep.dependencies.forEach(dep -> {
29-
def dependency = new JsonObject()
30-
dependency.addProperty('id', dep.name)
31-
dependency.addProperty('optional', dep.optional)
32-
dependencies.add(dependency)
33-
})
34-
info.add('dependencies', dependencies)
27+
if (description.dep.dependencies.size() > 0) {
28+
def dependencies = new JsonArray()
29+
description.dep.dependencies.findAll { it.with == null || it.with.equalsIgnoreCase('velocity') }.each { dep ->
30+
def dependency = new JsonObject()
31+
dependency.addProperty('id', dep.name)
32+
dependency.addProperty('optional', dep.optional)
33+
dependencies.add(dependency)
34+
}
35+
info.add('dependencies', dependencies)
36+
}
3537
return bytes(info)
3638
}
3739
}

0 commit comments

Comments
 (0)