-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from steakteam/refactoring
chore: add semantic-release, fix buildscript
- Loading branch information
Showing
14 changed files
with
5,305 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,26 @@ | ||
apply plugin: 'java' | ||
import kr.entree.chprotocol.build.VersionTask | ||
|
||
plugins { | ||
id 'java' | ||
id 'kr.entree.spigradle.base' version '1.3.1' | ||
id 'chprotocol-publish' | ||
} | ||
|
||
group = 'com.github.entrypointkr' | ||
version = '1.0.3' | ||
version = VersionTask.readVersion(project) | ||
|
||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
name = 'spigotmc-repo' | ||
url = 'https://hub.spigotmc.org/nexus/content/groups/public/' | ||
} | ||
maven { | ||
name = 'sk89q' | ||
url = 'http://maven.sk89q.com/repo' | ||
} | ||
maven { | ||
name = 'protocollib' | ||
url = 'https://repo.dmulloy2.net/nexus/repository/public/' | ||
} | ||
spigot() | ||
enginehub() | ||
protocolLib() | ||
} | ||
|
||
dependencies { | ||
compileOnly('com.sk89q:commandhelper:3.3.4-SNAPSHOT') { | ||
exclude module: 'spigot-api' | ||
} | ||
compileOnly(group: 'com.comphenix.protocol', name: 'ProtocolLib-API', version: '4.4.0') { | ||
exclude module: 'cglib-nodep' | ||
} | ||
compileOnly spigot() | ||
compileOnly commandhelper() | ||
compileOnly protocolLib() | ||
testImplementation group: 'junit', name: 'junit', version: '4.12' | ||
compileOnly 'org.spigotmc:spigot-api:1.13.1-R0.1-SNAPSHOT' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
plugins { | ||
id 'groovy-gradle-plugin' | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
plugins { | ||
id 'groovy' | ||
} | ||
|
||
task setVersion(type: kr.entree.chprotocol.build.VersionTask) |
29 changes: 29 additions & 0 deletions
29
buildSrc/src/main/groovy/kr/entree/chprotocol/build/VersionTask.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package kr.entree.chprotocol.build | ||
|
||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.Project | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.TaskAction | ||
import org.gradle.api.tasks.options.Option | ||
|
||
/** | ||
* Created by JunHyung Lim on 2020-07-02 | ||
*/ | ||
class VersionTask extends DefaultTask { | ||
static File getVersionFile(Project project) { | ||
return new File("${project.projectDir}/version.txt") | ||
} | ||
|
||
static String readVersion(Project project) { | ||
return getVersionFile(project).text | ||
} | ||
|
||
@Input | ||
@Option(option = "build-version", description = "Configure the version of CHProtocol.") | ||
def version = project.objects.property(String) | ||
|
||
@TaskAction | ||
def execute() { | ||
getVersionFile(project).text = version | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"devDependencies": { | ||
"@commitlint/cli": "^9.0.1", | ||
"@commitlint/config-conventional": "^9.0.1", | ||
"@semantic-release/changelog": "^5.0.1", | ||
"@semantic-release/git": "^9.0.0", | ||
"@semantic-release/github": "^7.0.7", | ||
"gradle-semantic-release-plugin": "^1.4.1", | ||
"husky": "^4.2.5", | ||
"semantic-release": "^17.1.1", | ||
"@semantic-release/exec": "^5.0.0" | ||
}, | ||
"scripts": { | ||
"semantic-release": "semantic-release" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
}, | ||
"commitlint": { | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
], | ||
"rules": { | ||
"body-max-line-length": [ | ||
0 | ||
] | ||
} | ||
}, | ||
"release": { | ||
"repositoryUrl": "https://github.com/steakteam/CHProtocol.git", | ||
"branches": [ | ||
"master" | ||
], | ||
"tagFormat": "v${version}", | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
"prepareCmd": "./gradlew setVersion --build-version ${nextRelease.version}", | ||
"publishCmd": "./gradlew assemble" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"version.txt", | ||
"CHANGELOG.md" | ||
] | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": [ | ||
"build/libs/*.jar" | ||
] | ||
} | ||
] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0.3 |
Oops, something went wrong.