This repository was archived by the owner on Feb 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11115 . 在项目根目录下执行 ` ./gradlew build -x test `
12126 . 在项目根目录下执行 ` ./gradlew test `
13137 . 删除 [ core] ( ./core ) 下的模板代码
14+ 8 . 修改 [ module-info.java] ( ./core/src/main/java/module-info.java ) 中的配置
1415
1516## 更新日志
1617
18+ - ** 20201208**
19+ - 新增 Java 9 模块化支持
20+ - 修复在使用` maven-publish ` 打包时未对源码打包的问题
21+
1722- ** 20201125**
1823 - 更改项目名称为 ` GradleKotlinTemplate `
1924 - 添加 ` maven-publish ` 插件,现在可以使用 ` gradlew publishToMavenLocal ` 了
Original file line number Diff line number Diff line change 1- group = " com.github.openEDGN "
1+ group = " com.github.OpenEDGN.GradleKotlinTemplate "
22// 你可以修改此为自己的组织地址
3- version = " 1.0 "
3+ version = " last "
44// 你可以指定此为项目 版本号
55
66buildscript {
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ val compileKotlin: KotlinCompile by tasks
1010val compileJava: JavaCompile by tasks
1111compileJava.destinationDir = compileKotlin.destinationDir
1212
13+ java {
14+ modularity.inferModulePath.set(true )
15+ }
1316
1417dependencies {
1518 implementation(kotlin(" reflect" ))
@@ -28,14 +31,18 @@ tasks.test {
2831tasks.withType<KotlinCompile >().configureEach {
2932 kotlinOptions.jvmTarget = " 11"
3033}
31-
34+ val sourcesJar by tasks.registering(Jar ::class ) {
35+ archiveClassifier.set(" sources" )
36+ from(sourceSets.main.get().allSource)
37+ }
3238publishing {
3339 publications {
3440 create<MavenPublication >(" maven" ) {
3541 groupId = rootProject.group.toString()
3642 artifactId = project.name
3743 version = rootProject.version.toString()
3844 from(components[" java" ])
45+ artifact(sourcesJar.get())
3946 }
4047 }
4148 repositories {
Original file line number Diff line number Diff line change 1+ module gradle .kotlin .template {
2+ requires kotlin .reflect ;
3+ requires kotlin .stdlib ;
4+ opens com .github .template ;
5+ exports com .github .template ;
6+ }
You can’t perform that action at this time.
0 commit comments