Skip to content

Commit

Permalink
simplify build
Browse files Browse the repository at this point in the history
  • Loading branch information
paulk-asert committed Dec 12, 2023
1 parent 90e890d commit e7c653f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 50 deletions.
54 changes: 11 additions & 43 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,55 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id 'org.kordamp.gradle.project' version '0.47.0'
id 'com.github.ben-manes.versions' version '0.47.0'
// uncomment when using JDK11+
// id 'com.autonomousapps.dependency-analysis' version '1.17.0'
id 'com.github.ben-manes.versions' version '0.50.0'
}

config {
info {
name = 'groovy-data-science'
vendor = 'paulk-asert'
description = 'Examples using Groovy for Data Science'
links {
website = 'https://github.com/paulk-asert/groovy-data-science'
issueTracker = 'https://github.com/paulk-asert/groovy-data-science/issues'
scm = 'https://github.com/paulk-asert/groovy-data-science.git'
}
}

publishing { enabled = false }

buildInfo {
skipBuildRevision = true
}

licensing {
excludes = ['*/rt-*', '*/training.*.txt', 'weights', '*.pdf',
'*.xlsx', '*.csv', '*_source.txt', '*/work/*', 'dummy.txt']
licenses {
license {
id = 'Apache-2.0'
}
}
ext.UNSTABLE = /^([0-9,.-]+[.-](alpha|beta|rc)[.\d-]*)|20030203.000550$/
// ignore non-stable releases
tasks.named("dependencyUpdates").configure {
gradleReleaseChannel = 'current'
outputFormatter = 'plain'
rejectVersionIf {
!(it.currentVersion.toLowerCase() ==~ UNSTABLE) && it.candidate.version.toLowerCase() ==~ UNSTABLE
}
}

ext.UNSTABLE = /^([0-9,.-]+[.-](alpha|beta|rc)[.\d-]*)|20030203.000550$/
// ignore non-stable releases
allprojects {
tasks.named("dependencyUpdates").configure {
gradleReleaseChannel = 'current'
outputFormatter = 'plain'
rejectVersionIf {
!(it.currentVersion.toLowerCase() ==~ UNSTABLE) && it.candidate.version.toLowerCase() ==~ UNSTABLE
}
}
config {
coverage {
jacoco { enabled = false }
}
repositories {
mavenCentral()
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ commonsIoVersion = 2.11.0
commonsMath3Version = 3.6.1
commonsMath4Version = 4.0-beta1
djlVersion = 0.22.1
groovy3Version = 3.0.17
groovy4Version = 4.0.12
groovy3Version = 3.0.19
groovy4Version = 4.0.16
igniteVersion = 2.15.0
jacksonVersion = 2.15.2
jfreechartVersion = 1.5.4
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@
*/
apply plugin: 'groovy'

repositories {
mavenCentral()
def runall = tasks.register('runAll') {
group 'Application'
}

FileUtil.baseNames(sourceSets.main.allSource.files, ['TablesawHelper']).each { name ->
tasks.register("run$name", JavaExec) {
def subtask = tasks.register("run$name", JavaExec) {
dependsOn compileGroovy
group 'Application'
description "Run ${name}.groovy as a JVM application/Groovy script"
classpath = sourceSets.main.runtimeClasspath
mainClass = name
}
runall.configure {
dependsOn subtask
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import org.apache.poi.xssf.usermodel.XSSFWorkbook
import java.text.SimpleDateFormat

var url = getClass().classLoader.getResource('Scented_all.xlsx')
var table = []
Expand All @@ -34,7 +35,8 @@ url.withInputStream { ins ->
}
}

var start2020 = Date.parse('dd-MMM-yyyy', '01-Jan-2020')
var sdf = new SimpleDateFormat('dd-MMM-yyyy', Locale.US)
var start2020 = sdf.parse('01-Jan-2020')
println GQL {
from row in table
where row.Date > start2020
Expand Down

0 comments on commit e7c653f

Please sign in to comment.