Skip to content

Commit

Permalink
Improve gradle files
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Saporetti Junior committed Apr 25, 2024
1 parent 4a3a065 commit 300b8cb
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 23 deletions.
33 changes: 33 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ idea {
excludeDirs += file('.idea')
excludeDirs += file('.gradle')
excludeDirs += file('.vscode')
excludeDirs += file('.run')
excludeDirs += file('run-configs')
excludeDirs += file('devel')
}
Expand Down Expand Up @@ -85,3 +86,35 @@ task listModules(type: Task) {
}
}
}

/* Download and extract the yorevs/py-gradle project ZIP */
task pyGradleUpdate(type: Task) {
group = 'build'
description = 'Download and extract the yorevs/py-gradle project ZIP'
doLast {
def gradleDir = "${rootDir}/gradle"
def outFile = "${gradleDir}/py-gradle.zip"
def url = "https://github.com/yorevs/py-gradle/archive/master.zip"
println "Downloading the yorevs/py-gradle project"
println " From: ${url}"
println " Into: ${outFile}"
mkdir gradleDir
exec {
commandLine 'curl', '-L', '-o', "${outFile}", url
}
copy {
from zipTree("${outFile}")
into "${gradleDir}"
}
copy {
from "${gradleDir}/py-gradle-master"
into "${gradleDir}"
}
delete fileTree(gradleDir).matching {
include "README*"
include "LICENSE*"
include "py-gradle*"
}
delete "${gradleDir}/py-gradle-master"
}
}
12 changes: 0 additions & 12 deletions modules/hqt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ apply from: "$rootDir/gradle/docker.gradle"
apply from: "$rootDir/gradle/oracle.gradle"
apply from: "$rootDir/gradle/docgen.gradle"

task copyReadme(type: Copy) {
group = 'Publish'
description = "Copy README into main folder"
from(rootDir) {
include 'README.md'
}
into "$sourceRoot/main"
}

/* Update hspylib version in all subprojects */
task updateSubprojectsVersion(type: Task) {
group = 'Dependencies'
Expand All @@ -62,6 +53,3 @@ task updateSubprojectsVersion(type: Task) {
}
}
}

copyLicense.finalizedBy(copyReadme)
publish.finalizedBy(updateSubprojectsVersion)
11 changes: 0 additions & 11 deletions modules/hspylib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,3 @@ apply from: "$rootDir/gradle/pypi-publish.gradle"
apply from: "$rootDir/gradle/docker.gradle"
apply from: "$rootDir/gradle/oracle.gradle"
apply from: "$rootDir/gradle/docgen.gradle"

task copyReadme(type: Copy) {
group = 'Publish'
description = "Copy README into main folder"
from(rootDir) {
include 'README.md'
}
into "$sourceRoot/main"
}

copyLicense.finalizedBy(copyReadme)

0 comments on commit 300b8cb

Please sign in to comment.