init: 项目初始化
项目初始化
This commit is contained in:
65
build.gradle
Normal file
65
build.gradle
Normal 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", "")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user