You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.4 KiB
71 lines
1.4 KiB
plugins {
|
|
id 'java'
|
|
id 'application'
|
|
}
|
|
|
|
import org.apache.tools.ant.taskdefs.condition.Os
|
|
|
|
group 'com.emzi0767'
|
|
version '1.0.0'
|
|
mainClassName = 'com.emzi0767.discord.Main'
|
|
|
|
sourceCompatibility = 1.8
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
|
}
|
|
|
|
task printPath(type: Exec) {
|
|
workingDir "ref/css-injector"
|
|
executable "cmd"
|
|
args "/c", "echo PATH = %PATH%"
|
|
}
|
|
|
|
task restoreInjectorDeps(type: Exec) {
|
|
String npm = "npm"
|
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
npm = "npm.cmd"
|
|
}
|
|
|
|
workingDir "ref/css-injector"
|
|
executable npm
|
|
args "install", "--save"
|
|
}
|
|
|
|
task buildInjector(type: Exec, dependsOn: restoreInjectorDeps) {
|
|
String npm = "npm"
|
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
npm = "npm.cmd"
|
|
}
|
|
|
|
workingDir "ref/css-injector"
|
|
executable npm
|
|
args "run", "release"
|
|
}
|
|
|
|
task copyInjector(type: Copy, dependsOn: buildInjector) {
|
|
mkdir "src/main/resources/injector"
|
|
|
|
from "ref/css-injector/dist/index.js"
|
|
into "src/main/resources/injector"
|
|
rename { filename ->
|
|
filename.replace "index", "discord-css-injector"
|
|
}
|
|
}
|
|
|
|
buildInjector.finalizedBy copyInjector
|
|
|
|
jar {
|
|
dependsOn buildInjector
|
|
|
|
archiveName "${jar.baseName}.${jar.extension}"
|
|
manifest {
|
|
attributes(
|
|
'Main-Class': mainClassName
|
|
)
|
|
}
|
|
}
|