init: 项目初始化

项目初始化
This commit is contained in:
2022-08-06 01:15:48 +08:00
commit 75b06aae41
33 changed files with 2610 additions and 0 deletions

65
build.gradle Normal file
View File

@@ -0,0 +1,65 @@
plugins {
id 'java'
}
group 'cn.hamster3.mc'
version '1.0.0-SNAPSHOT'
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
group = rootProject.group
version = rootProject.version
repositories {
maven {
url = "https://maven.airgame.net/maven-public/"
}
}
dependencies {
compileOnly group: 'org.jetbrains', name: 'annotations', version: '21.0.1'
}
tasks.withType(JavaCompile) {
options.setEncoding("UTF-8")
}
tasks.withType(Jar) {
from([rootProject.file("LICENSE")])
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
// withJavadocJar()
withSourcesJar()
}
jar {
destinationDir(rootProject.buildDir)
}
publishing {
publications {
mavenJava(MavenPublication) {
from getProject().getComponents().java
}
}
repositories {
maven {
def releasesRepoUrl = 'https://maven.airgame.net/maven-releases/'
def snapshotsRepoUrl = 'https://maven.airgame.net/maven-snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username rootProject.getProperties().getOrDefault("maven_username", "")
password rootProject.getProperties().getOrDefault("maven_password", "")
}
}
}
}
}