Initial Commit with code from old repo with new Jenkinsfile
Some checks failed
andreas-personal/AndysAdguardHomeBlocklist/pipeline/head There was a failure building this commit
Some checks failed
andreas-personal/AndysAdguardHomeBlocklist/pipeline/head There was a failure building this commit
This commit is contained in:
42
build.gradle
Normal file
42
build.gradle
Normal file
@ -0,0 +1,42 @@
|
||||
import groovy.json.JsonSlurper
|
||||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*
|
||||
* This is a general purpose Gradle build.
|
||||
* To learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.7/samples
|
||||
*/
|
||||
|
||||
def getLatestNodeVersionForMajor(int majorVersion) {
|
||||
def nodeDistUrl = 'https://nodejs.org/dist/index.json'
|
||||
def jsonSlurper = new JsonSlurper()
|
||||
def nodeVersions = jsonSlurper.parseText(nodeDistUrl.toURL().text)
|
||||
|
||||
nodeVersions.find { it.version.startsWith("v${majorVersion}.") }.version.substring(1)
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "com.dorongold.task-tree" version "3.0.0"
|
||||
id "com.github.node-gradle.node" version "7.0.2"
|
||||
}
|
||||
|
||||
node {
|
||||
download = true
|
||||
version = getLatestNodeVersionForMajor(20)
|
||||
npmInstallCommand = 'clean-install'
|
||||
}
|
||||
|
||||
npmInstall {
|
||||
inputs.files file('package.json'), file('package-lock.json')
|
||||
outputs.dir file('node_modules')
|
||||
}
|
||||
|
||||
task createOutDir {
|
||||
doLast {
|
||||
file("out").mkdirs()
|
||||
}
|
||||
}
|
||||
|
||||
task compileAdblockList(type: NpmTask) {
|
||||
dependsOn npmInstall, createOutDir
|
||||
args = ['run', 'compile']
|
||||
}
|
Reference in New Issue
Block a user