Skip to content

Commit

Permalink
[ci] Uses recommended way to create task in build.gradle (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu authored Mar 9, 2023
1 parent acb0256 commit 3cf2616
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
8 changes: 6 additions & 2 deletions benchmark/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'application'
id "nebula.ospackage" version "9.1.1"
id 'com.netflix.nebula.ospackage' version '11.0.0'
}

dependencies {
Expand Down Expand Up @@ -91,13 +91,17 @@ tasks.register('benchmark', JavaExec) {
mainClass = "ai.djl.benchmark.Benchmark"
}

tasks.register('createDeb', Deb) {
tasks.register('prepareDeb') {
dependsOn distTar
doFirst {
exec {
commandLine "tar", "xvf", "${project.buildDir}/distributions/benchmark-${project.version}.tar", "-C", "${project.buildDir}"
}
}
}

tasks.register('createDeb', Deb) {
dependsOn prepareDeb

packageName = "djl-bench"
archiveVersion = "${project.version}"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
2 changes: 1 addition & 1 deletion plugins/kserve/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
}
}

task copyJar(type: Copy) {
tasks.register('copyJar', Copy) {
from jar // here it automatically reads jar file produced from jar task
into "../../serving/plugins"
}
Expand Down
5 changes: 3 additions & 2 deletions plugins/management-console/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ clean {
}
}

task buildConsoleApp(type: NpmTask, dependsOn: "npmInstall") {
tasks.register('buildConsoleApp', NpmTask) {
dependsOn "npmInstall"
project.logger.info("Build the DJL Management console application")
npmCommand = ["run", "build"]
}

task copyJar(type: Copy) {
tasks.register('copyJar', Copy) {
from jar // here it automatically reads jar file produced from jar task
into "../../serving/plugins"
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugin-management-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies {
}
}

task copyJar(type: Copy) {
tasks.register('copyJar', Copy) {
from jar // here it automatically reads jar file produced from jar task
into '../../serving/plugins'
}
Expand Down
8 changes: 6 additions & 2 deletions serving/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'application'
id "nebula.ospackage" version "9.1.1"
id 'com.netflix.nebula.ospackage' version '11.0.0'
}

dependencies {
Expand Down Expand Up @@ -69,13 +69,17 @@ clean {
delete file("logs")
}

tasks.register('createDeb', Deb) {
tasks.register('prepareDeb') {
dependsOn distTar
doFirst {
exec {
commandLine "tar", "xvf", "${project.buildDir}/distributions/serving-${project.version}.tar", "-C", "${project.buildDir}"
}
}
}

tasks.register('createDeb', Deb) {
dependsOn prepareDeb

packageName = "djl-serving"
archiveVersion = "${project.version}"
Expand Down

0 comments on commit 3cf2616

Please sign in to comment.