Skip to content

Commit

Permalink
Add: change to Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
xfl03 committed Jan 31, 2023
1 parent 43ed963 commit ab494f8
Show file tree
Hide file tree
Showing 29 changed files with 597 additions and 423 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ hs_err_pid*
## Gradle
.gradle/
build/
gradle/
gradlew
out/
output/
run/
!gradle/wrapper/gradle-wrapper.jar

## sublime
*.sublime*
Expand All @@ -53,4 +52,4 @@ target/

*~

run
Library
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 to2mbn
Copyright (c) 2016-2023 yushijinhun, xfl03 and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# JMCCC
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Southern-InfinityStudio/JMCCC?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Build Status](https://travis-ci.org/to2mbn/JMCCC.svg?branch=master)](https://travis-ci.org/to2mbn/JMCCC)<br/>
[![Maven Central](https://img.shields.io/maven-central/v/dev.3-3/jmccc)](https://central.sonatype.com/search?q=jmccc&namespace=dev.3-3)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Southern-InfinityStudio/JMCCC?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

A powerful open-source library for launching and downloading Minecraft.

## License
Expand Down Expand Up @@ -35,15 +37,14 @@ JMCCC is licensed under [the MIT license](https://github.com/xfl03/JMCCC/LICENSE
| `dev.3-3:jmccc-mcdownloader` | Minecraft downloading feature. |
| `dev.3-3:jmccc-mojang-api` | Mojang API client. |

The snapshot repository:
```xml
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
JMCCC **RELEASE** version has been uploaded to **MAVEN CENTRAL**:
```
https://repo1.maven.org/maven2/
```

If you do need the snapshot repository:
```
https://s01.oss.sonatype.org/content/repositories/snapshots/
```

### Launching Minecraft
Expand Down
21 changes: 11 additions & 10 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# JMCCC
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Southern-InfinityStudio/JMCCC?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Build Status](https://travis-ci.org/to2mbn/JMCCC.svg?branch=master)](https://travis-ci.org/to2mbn/JMCCC)<br/>
[![Maven Central](https://img.shields.io/maven-central/v/dev.3-3/jmccc)](https://central.sonatype.com/search?q=jmccc&namespace=dev.3-3)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Southern-InfinityStudio/JMCCC?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

一个用来下载并启动Minecraft的强大的开源类库。

## 许可证
Expand Down Expand Up @@ -35,15 +37,14 @@ JMCCC使用[MIT许可证](https://github.com/xfl03/JMCCC/LICENSE)。
| `dev.3-3:jmccc-mcdownloader` | 提供下载Minecraft的功能 |
| `dev.3-3:jmccc-mojang-api` | Mojang API客户端 |

快照版本(snapshot)的Maven仓库:
```xml
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
JMCCC的**正式版本**(release) 已上传至 **Maven Central**:
```
https://repo1.maven.org/maven2/
```

快照版本(snapshot)的Maven仓库:
```
https://s01.oss.sonatype.org/content/repositories/snapshots/
```

### 启动Minecraft
Expand Down
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plugins {
base
}

version = "3.0.1"

subprojects {
//Real subproject DSL is located at `buildSrc/src/main/kotlin/dev.3-3.jmccc.gradle.kts`
apply(plugin = "dev.3-3.jmccc")
}
9 changes: 9 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
// Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build.
`kotlin-dsl`
}

repositories {
// Use the plugin portal to apply community plugins in convention plugins.
gradlePluginPortal()
}
122 changes: 122 additions & 0 deletions buildSrc/src/main/kotlin/dev.3-3.jmccc.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
plugins {
`java-library`
`maven-publish`
}

dependencies {
testImplementation("junit:junit:4.13.1")
}

group = "dev.3-3"
version = rootProject.version

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}

tasks {
compileJava {
options.encoding = "UTF-8"
}
javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
options {
encoding = "UTF-8"
(this as CoreJavadocOptions).addStringOption("Xdoclint:none", "-quiet")
}
}
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
if (tasks.findByName("shadowJar") != null) {
artifact(tasks["shadowJar"])
}
pom {
description.set("JMCCC is a powerful open-source library for launching and downloading Minecraft.")
url.set("https://github.com/xfl03/JMCCC")
licenses {
license {
name.set("MIT")
url.set("https://github.com/xfl03/JMCCC/LICENSE")
distribution.set("repo")
comments.set(
"""
The MIT License (MIT)
Copyright (c) 2016-2023 yushijinhun, xfl03 and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
""".trimIndent()
)
}
}
developers {
developer {
id.set("darkyoooooo")
name.set("Qiyun Zhou")
email.set("[email protected]")
url.set("https://github.com/darkyoooooo")
}
developer {
id.set("yushijinhun")
name.set("Haowei Wen")
email.set("[email protected]")
url.set("https://github.com/yushijinhun")
}
developer {
id.set("xfl03")
name.set("xfl03")
email.set("[email protected]")
url.set("https://github.com/xfl03")
}
}
scm {
connection.set("scm:git:git://github.com/xfl03/JMCCC.git")
developerConnection.set("scm:git:[email protected]:xfl03/JMCCC.git")
tag.set("master")
url.set("https://github.com/xfl03/JMCCC")
}
issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/xfl03/JMCCC/issues")
}
}
}
}
repositories {
maven {
name = "ossrh"
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit ab494f8

Please sign in to comment.