mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
Use CivGradle 2.+
This commit is contained in:
@@ -1,43 +1,24 @@
|
||||
name: "Build"
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- '*'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
distribution: temurin
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
- uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
'**/.gradle/caches'
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Build
|
||||
run: ./gradlew build
|
||||
|
||||
- name: Analyze
|
||||
if: ${{ env.SONAR_TOKEN }}
|
||||
run: ./gradlew sonarqube
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
arguments: build
|
||||
|
||||
@@ -1,39 +1,25 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
distribution: temurin
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
- uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
'**/.gradle/caches'
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Publish
|
||||
run: ./gradlew publish
|
||||
arguments: publish
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CIVMC_NEXUS_USER: ${{ secrets.CIVMC_NEXUS_USER }}
|
||||
CIVMC_NEXUS_PASSWORD: ${{ secrets.CIVMC_NEXUS_PASSWORD }}
|
||||
CIVMC_NEXUS_PASSWORD: ${{ secrets.CIVMC_NEXUS_PASSWORD }}
|
||||
33
plugins/civmodcore-paper/.gitignore
vendored
33
plugins/civmodcore-paper/.gitignore
vendored
@@ -1,12 +1,23 @@
|
||||
/bin
|
||||
/target/
|
||||
.classpath
|
||||
.project
|
||||
.settings/**
|
||||
/logs/
|
||||
.idea/
|
||||
# Gradle
|
||||
.gradle/
|
||||
build/
|
||||
run/
|
||||
|
||||
# Editors
|
||||
## Idea
|
||||
.idea
|
||||
*.iml
|
||||
.gradle
|
||||
build
|
||||
*/.settings/**
|
||||
**/bin/
|
||||
*.iws
|
||||
|
||||
## VIM
|
||||
*.swp
|
||||
|
||||
# OS
|
||||
## MacOS
|
||||
.DS_Store
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
Icon?
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
val pluginName: String by project
|
||||
import net.civmc.civgradle.CivGradleExtension
|
||||
|
||||
plugins {
|
||||
id("org.sonarqube") version "3.3"
|
||||
id("net.civmc.civgradle") version "2.+" apply false
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "java-library")
|
||||
apply(plugin = "maven-publish")
|
||||
apply(plugin = "net.civmc.civgradle")
|
||||
|
||||
project.setProperty("archivesBaseName", "$pluginName-$name-$version")
|
||||
|
||||
configure<JavaPluginExtension> {
|
||||
withJavadocJar()
|
||||
withSourcesJar()
|
||||
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
configure<CivGradleExtension> {
|
||||
pluginName = project.property("pluginName") as String
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -26,40 +20,4 @@ subprojects {
|
||||
|
||||
maven("https://jitpack.io")
|
||||
}
|
||||
|
||||
configure<PublishingExtension> {
|
||||
repositories {
|
||||
maven {
|
||||
name = "GitHubPackages"
|
||||
url = uri("https://maven.pkg.github.com/CivMC/$pluginName")
|
||||
credentials {
|
||||
username = System.getenv("GITHUB_ACTOR")
|
||||
password = System.getenv("GITHUB_TOKEN")
|
||||
}
|
||||
}
|
||||
|
||||
val targetRepo = if (version.toString().endsWith("SNAPSHOT")) "maven-snapshots" else "maven-releases"
|
||||
maven {
|
||||
name = "CivMC"
|
||||
url = uri("https://repo.civmc.net/repository/$targetRepo/")
|
||||
credentials {
|
||||
username = System.getenv("CIVMC_NEXUS_USER")
|
||||
password = System.getenv("CIVMC_NEXUS_PASSWORD")
|
||||
}
|
||||
}
|
||||
}
|
||||
publications {
|
||||
register<MavenPublication>("mavenJava") {
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sonarqube {
|
||||
properties {
|
||||
property("sonar.projectKey", "CivMC_$pluginName")
|
||||
property("sonar.organization", "civmc")
|
||||
property("sonar.host.url", "https://sonarcloud.io")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,39 +1,26 @@
|
||||
val pluginName: String by project
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
id("io.papermc.paperweight.userdev") version "1.3.3"
|
||||
id("com.github.johnrengelman.shadow") version "7.1.0"
|
||||
id("io.papermc.paperweight.userdev")
|
||||
id("com.github.johnrengelman.shadow")
|
||||
id("xyz.jpenilla.run-paper")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
paperDevBundle("1.18.2-R0.1-SNAPSHOT")
|
||||
|
||||
implementation("co.aikar:acf-bukkit:0.5.0-SNAPSHOT")
|
||||
implementation("com.mojang:datafixerupper:1.0.20")
|
||||
implementation("com.zaxxer:HikariCP:3.4.2")
|
||||
implementation("co.aikar:taskchain-bukkit:3.7.2")
|
||||
implementation("com.github.IPVP-MC:canvas:91ec97f076")
|
||||
implementation("org.apache.commons:commons-lang3:3.12.0")
|
||||
implementation("org.apache.commons:commons-collections4:4.4")
|
||||
implementation("com.google.code.findbugs:jsr305:3.0.2")
|
||||
implementation("co.aikar:acf-bukkit:0.5.0-SNAPSHOT")
|
||||
implementation("com.mojang:datafixerupper:1.0.20")
|
||||
implementation("com.zaxxer:HikariCP:3.4.2")
|
||||
implementation("co.aikar:taskchain-bukkit:3.7.2")
|
||||
implementation("com.github.IPVP-MC:canvas:91ec97f076")
|
||||
implementation("org.apache.commons:commons-lang3:3.12.0")
|
||||
implementation("org.apache.commons:commons-collections4:4.4")
|
||||
implementation("com.google.code.findbugs:jsr305:3.0.2")
|
||||
|
||||
compileOnly("it.unimi.dsi:fastutil:8.2.2")
|
||||
compileOnly("it.unimi.dsi:fastutil:8.2.2")
|
||||
|
||||
compileOnly("org.projectlombok:lombok:1.18.20")
|
||||
annotationProcessor ("org.projectlombok:lombok:1.18.20")
|
||||
compileOnly("org.projectlombok:lombok:1.18.20")
|
||||
annotationProcessor ("org.projectlombok:lombok:1.18.20")
|
||||
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.2.0")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.2.0")
|
||||
}
|
||||
|
||||
tasks {
|
||||
processResources {
|
||||
filesMatching("plugin.yml") {
|
||||
expand(mapOf(
|
||||
"name" to pluginName,
|
||||
"version" to version,
|
||||
))
|
||||
}
|
||||
}
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.2.0")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.2.0")
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
rootProject.name = "civmodcore"
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
maven("https://repo.civmc.net/repository/maven-public/")
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "civmodcore"
|
||||
|
||||
include(":paper")
|
||||
project(":paper").name = rootProject.name + "-paper"
|
||||
|
||||
Reference in New Issue
Block a user