Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 14ee6ad

Browse files
20210322
1 parent b2fe9b2 commit 14ee6ad

13 files changed

Lines changed: 215 additions & 69 deletions

File tree

.gitignore

Lines changed: 118 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,119 @@
1-
*.iml
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Java template
3+
# Compiled class file
4+
*.class
5+
6+
# Log file
7+
*.log
8+
9+
# BlueJ files
10+
*.ctxt
11+
12+
# Mobile Tools for Java (J2ME)
13+
.mtj.tmp/
14+
15+
# Package Files #
16+
*.jar
17+
*.war
18+
*.nar
19+
*.ear
20+
*.zip
21+
*.tar.gz
22+
*.rar
23+
24+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
25+
hs_err_pid*
26+
27+
### Gradle template
228
.gradle
3-
.idea
4-
/local.properties
5-
/.idea/caches
6-
/.idea/libraries
7-
/.idea/modules.xml
8-
/.idea/workspace.xml
9-
/.idea/navEditor.xml
10-
/.idea/assetWizardSettings.xml
11-
.DS_Store
12-
/build
13-
/captures
14-
.externalNativeBuild
15-
*.tmp
29+
**/build/
30+
!src/**/build/
31+
32+
# Ignore Gradle GUI config
33+
gradle-app.setting
34+
35+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
36+
!gradle-wrapper.jar
37+
38+
# Cache of project
39+
.gradletasknamecache
40+
41+
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
42+
# gradle/wrapper/gradle-wrapper.properties
43+
44+
### JetBrains template
45+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
46+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
47+
48+
# User-specific stuff
49+
.idea/**/workspace.xml
50+
.idea/**/tasks.xml
51+
.idea/**/usage.statistics.xml
52+
.idea/**/dictionaries
53+
.idea/**/shelf
54+
55+
# Generated files
56+
.idea/**/contentModel.xml
57+
58+
# Sensitive or high-churn files
59+
.idea/**/dataSources/
60+
.idea/**/dataSources.ids
61+
.idea/**/dataSources.local.xml
62+
.idea/**/sqlDataSources.xml
63+
.idea/**/dynamic.xml
64+
.idea/**/uiDesigner.xml
65+
.idea/**/dbnavigator.xml
66+
67+
# Gradle
68+
.idea/**/gradle.xml
69+
.idea/**/libraries
70+
71+
# Gradle and Maven with auto-import
72+
# When using Gradle or Maven with auto-import, you should exclude module files,
73+
# since they will be recreated, and may cause churn. Uncomment if using
74+
# auto-import.
75+
# .idea/artifacts
76+
# .idea/compiler.xml
77+
# .idea/jarRepositories.xml
78+
# .idea/modules.xml
79+
# .idea/*.iml
80+
# .idea/modules
81+
# *.iml
82+
# *.ipr
83+
84+
# CMake
85+
cmake-build-*/
86+
87+
# Mongo Explorer plugin
88+
.idea/**/mongoSettings.xml
89+
90+
# File-based project format
91+
*.iws
92+
93+
# IntelliJ
94+
out/
95+
96+
# mpeltonen/sbt-idea plugin
97+
.idea_modules/
98+
99+
# JIRA plugin
100+
atlassian-ide-plugin.xml
101+
102+
# Cursive Clojure plugin
103+
.idea/replstate.xml
104+
105+
# Crashlytics plugin (for Android Studio and IntelliJ)
106+
com_crashlytics_export_strings.xml
107+
crashlytics.properties
108+
crashlytics-build.properties
109+
fabric.properties
110+
111+
# Editor-based Rest Client
112+
.idea/httpRequests
113+
114+
# Android studio 3.1+ serialized cache file
115+
.idea/caches/build_file_checksums.ser
116+
117+
118+
119+
!.gitkeep

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,45 @@
22

33
> 一套简单的 Kotlin DSL Gradle 项目
44
5+
## 特性
6+
7+
- 跟随`Gradle``Kotlin` 最新稳定版本
8+
- 支持 `Java Module`
9+
- 针对中华人民共和国配置 `Maven` 加速镜像
10+
511
## 快速开始
612

713
1.`https://github.com/OpenEdgn/GradleKotlinTemplate` 克隆项目
814
2. 修改[LICENSE](./LICENSE) 为合适的分发协议
915
3. 重建 [README.md](./README.md) 文件
1016
4. 修改 [settings.gradle.kts](./settings.gradle.kts)`project.name` 为合适的名称
11-
5. 在项目根目录下执行 `./gradlew build -x test`
17+
5. 在项目根目录下执行 `./gradlew build -x test`
1218
6. 在项目根目录下执行 `./gradlew test`
1319
7. 删除 [core](./core) 下的模板代码
1420
8. 修改 [module-info.java](./core/src/main/java/module-info.java) 中的配置
1521

1622
## 更新日志
1723

18-
- **20201208**
24+
- **20210322**
25+
- 更新 `Kolin` 版本至 `1.4.31`
26+
- 更新 `Gradle` 版本至 `6.8.3`
27+
- 去除 `resources` 下孤立文件
28+
- 将插件版本配置合并到 [gradle.properties](./gradle.properties)
29+
30+
- **20201208**
1931
- 新增 Java 9 模块化支持
2032
- 修复在使用`maven-publish`打包时未对源码打包的问题
2133

2234
- **20201125**
2335
- 更改项目名称为 `GradleKotlinTemplate`
2436
- 添加 `maven-publish` 插件,现在可以使用 `gradlew publishToMavenLocal`
25-
- 修改 `Kotlin` 插件编译生成目录 [build.gradle.kts](./core/build.gradle.kts#L9)
26-
37+
- 修改 `Kotlin` 插件编译生成目录 [build.gradle.kts](./core/build.gradle.kts#L9)
38+
2739
- **20201120**
2840
- 更新 `kotlin``1.4.10`
2941
- 更新 `gradle``6.5.1`
3042
- 删除过时的 `buildSrc` 方案
3143

3244
## LICENSE
3345

34-
请看 [LICENSE](./LICENSE) 来了解此模板的 LICENSE
46+
请看 [LICENSE](./LICENSE) 来了解此模板的 LICENSE

build.gradle.kts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
1-
group = "com.github.OpenEDGN.GradleKotlinTemplate"
1+
group = "com.github.OpenEDGN"
22
// 你可以修改此为自己的组织地址
33
version = "last"
44
// 你可以指定此为项目 版本号
55

66
buildscript {
7-
repositories{
7+
repositories {
88
mavenLocal()
99
maven { url = project.uri("https://maven.aliyun.com/repository/public/") }
10-
jcenter()
10+
maven { url = project.uri("https://mirrors.163.com/maven/repository/maven-public/") }
11+
// maven 中国镜像,提供加速
1112
mavenCentral()
1213
maven { url = project.uri("https://jitpack.io") }
1314
}
15+
16+
val kotlinVersion: String by project
17+
1418
dependencies {
15-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10")
19+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
1620
}
1721
}
1822

1923
allprojects {
20-
repositories{
24+
repositories {
2125
mavenLocal()
26+
maven { url = project.uri("https://maven.aliyun.com/repository/gradle-plugin/") }
2227
maven { url = project.uri("https://maven.aliyun.com/repository/public/") }
23-
jcenter()
28+
maven { url = project.uri("https://mirrors.163.com/maven/repository/maven-public/") }
29+
// maven 中国镜像,提供加速
2430
mavenCentral()
2531
maven { url = project.uri("https://jitpack.io") }
26-
}}
32+
}
33+
}
2734

2835
tasks.register("clean", Delete::class) {
2936
delete(rootProject.buildDir)

core/src/main/resources/.gitkeep

Whitespace-only changes.

core/src/main/resources/application.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

core/src/test/resources/.gitkeep

Whitespace-only changes.

core/src/test/resources/test.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

gradle.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# A hack to allow opening whole project dir in Intellij and using official code style.
2+
# Kotlin plugin does not import code style property from Gradle.
3+
# Instead it parses project's root gradle.properties file.
4+
kotlin.code.style=official
5+
6+
# Version
7+
kotlinVersion=1.4.31

gradle/wrapper/gradle-wrapper.jar

4.76 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sun Nov 03 20:02:05 CST 2019
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip

0 commit comments

Comments
 (0)