Skip to content

Commit 969b1c8

Browse files
committed
2.0.21 新增两个配置
1 parent dacdc1b commit 969b1c8

File tree

5 files changed

+38
-25
lines changed

5 files changed

+38
-25
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.20"
11+
version = "2.0.21"
1212

1313
configurations {
1414
create("embed") {

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

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,27 +104,30 @@ class TabooLibMainTask extends DefaultTask {
104104
}
105105
// endregion
106106
// 描述文件
107-
try {
108-
out.putNextEntry(new JarEntry("META-INF/taboolib/env.properties"))
109-
out.write(buildEnv())
110-
out.putNextEntry(new JarEntry("META-INF/taboolib/version.properties"))
111-
out.write(buildVersion())
112-
} catch (ZipException ignored) {
107+
if (!tabooExt.version.skipVersionFile) {
108+
try {
109+
out.putNextEntry(new JarEntry("META-INF/taboolib/env.properties"))
110+
out.write(buildEnv())
111+
out.putNextEntry(new JarEntry("META-INF/taboolib/version.properties"))
112+
out.write(buildVersion())
113+
} catch (ZipException ignored) {
114+
}
113115
}
114116
// 插件文件
115-
Platforms.values().each {
116-
if (tabooExt.env.modules.contains(it.module)) {
117-
try {
118-
out.putNextEntry(new JarEntry(it.file))
119-
out.write(it.builder.build(tabooExt.des, project, tabooExt))
120-
} catch (ZipException ignored) {
117+
if (!tabooExt.version.skipPlatformFile) {
118+
Platforms.values().each {
119+
if (tabooExt.env.modules.contains(it.module)) {
120+
try {
121+
out.putNextEntry(new JarEntry(it.file))
122+
out.write(it.builder.build(tabooExt.des, project, tabooExt))
123+
} catch (ZipException ignored) {
124+
}
121125
}
122126
}
123127
}
124128
null
125129
}
126130
}
127-
// api mode
128131
Files.copy(tempOut1.toPath(), outJar.toPath(), StandardCopyOption.REPLACE_EXISTING)
129132
}
130133

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,15 @@ class TabooLibPlugin implements Plugin<Project> {
6767
project.dependencies.add('testImplementation', 'org.jetbrains.kotlinx:kotlinx-coroutines-core:' + tabooExt.version.coroutines)
6868
}
6969
// 自动引入 TabooLib 模块
70-
tabooExt.env.modules.each {
71-
def dependency = project.dependencies.create("io.izzel.taboolib:${it}:${tabooExt.version.taboolib}")
72-
if (api || isCoreModule(it) && !tabooExt.subproject) {
73-
project.configurations.taboo.dependencies.add(dependency)
74-
} else {
75-
project.configurations.compileOnly.dependencies.add(dependency)
76-
project.configurations.testImplementation.dependencies.add(dependency)
70+
if (tabooExt.version.taboolib != null) {
71+
tabooExt.env.modules.each {
72+
def dependency = project.dependencies.create("io.izzel.taboolib:${it}:${tabooExt.version.taboolib}")
73+
if (api || isCoreModule(it) && !tabooExt.subproject) {
74+
project.configurations.taboo.dependencies.add(dependency)
75+
} else {
76+
project.configurations.compileOnly.dependencies.add(dependency)
77+
project.configurations.testImplementation.dependencies.add(dependency)
78+
}
7779
}
7880
}
7981

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
package io.izzel.taboolib.gradle
22

3-
import org.jetbrains.annotations.NotNull
3+
44
import org.jetbrains.annotations.Nullable
55

66
class Version {
77

88
/** Coroutines 版本 */
9-
@Nullable String coroutines = "1.7.3"
9+
@Nullable
10+
String coroutines = "1.7.3"
1011

1112
/** TabooLib 版本 */
12-
@NotNull String taboolib = "6.1.0-dev"
13+
@Nullable
14+
String taboolib = null
1315

1416
/** 跳过 Kotlin */
1517
boolean skipKotlin = false
@@ -19,4 +21,10 @@ class Version {
1921

2022
/** 跳过 TabooLib 重定向 */
2123
boolean skipTabooLibRelocate = false
24+
25+
/** 跳过版本描述文件 */
26+
boolean skipVersionFile = false
27+
28+
/** 跳过平台描述文件 */
29+
boolean skipPlatformFile = false
2230
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract class Builder {
1717
def str = []
1818
str += ''
1919
str += ''
20-
str += '# Powered by TabooLib 6.1 #'
20+
str += '# Powered by TabooLib 6.2 #'
2121
str += ''
2222
str += ''
2323
return str

0 commit comments

Comments
 (0)