Advanced-Portals/build.gradle

99 lines
2.6 KiB
Groovy

import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.StandardCopyOption
import java.nio.file.StandardOpenOption
buildscript {
repositories {
maven {url "https://plugins.gradle.org/m2/"}
mavenCentral()
}
dependencies {
classpath "org.apache.httpcomponents:httpmime:4.5.13"
classpath "com.google.code.gson:gson:2.8.6"
classpath "org.apache.httpcomponents:httpclient:4.5.13"
}
}
plugins {
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
}
apply from: 'env-variables.gradle'
apply from: 'changelog-util.gradle'
allprojects {
apply plugin: 'java'
apply plugin: 'idea'
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
if (project.name != "Advanced-Portals") {
task buildSubmodules doLast {
task -> println "Building $task.project.name"
}
buildSubmodules.finalizedBy build
}
tasks.processResources {
def files = ["plugin.yml", "bungee.yml"]
filesMatching(files) {
expand(["pluginVersion": project.version])
}
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
ext.branch = rootProject.ext.branch
ext.snapshotName = rootProject.ext.snapshotName
ext.githubSha = rootProject.ext.githubSha
ext.shaRef = rootProject.ext.shaRef
ext.isRelease = rootProject.ext.isRelease
def versionString = (rootProject.file('./version.txt').text + (isRelease ? "" : "-${snapshotName}${shaRef}")).replaceAll('\n', '').replaceAll('\r', '')
setVersion(versionString)
}
println("Branch ${ext.branch}${ext.shaRef} isRelease: '${ext.isRelease}'")
println("Snapshot Name: ${ext.snapshotName}")
println("Github SHA: ${ext.githubSha}")
println("Sha Ref: ${ext.shaRef}")
group = 'com.sekwah.advancedportals'
println "Version: ${getVersion()}"
description = ""
configurations {
// configuration that holds jars to copy into lib
implementation.extendsFrom(includeLibs)
}
repositories {
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://nexus.velocitypowered.com/repository/maven-public/" }
}
// Needed to find generateTemplates task
evaluationDependsOn(':core')
println "Branch ${ext.branch}${ext.shaRef} isRelease: '${ext.isRelease}'"
idea {
project {
settings {
taskTriggers {
afterSync(project(':core').tasks.named('generateTemplates').get())
}
}
}
}