Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: [#53] Create parallel gradle build for CI #149

Merged
merged 77 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e82a813
Set up parallel gradle build for au.com.trgtd.tr.util and .resource
ursjoss Oct 5, 2024
ef2e86e
au.com.trgtd.tr.runtime
ursjoss Oct 5, 2024
eda2c27
au.com.trgtd.tr.appl
ursjoss Oct 5, 2024
18a67b5
au.com.trgtd.tr.prefs.dates
ursjoss Oct 5, 2024
46f8ee7
au.com.trgtd.tr.swing
ursjoss Oct 5, 2024
2cb168e
au.com.trgtd.tr.calendar
ursjoss Oct 5, 2024
4bb23bb
au.com.trgtd.tr.calendar.ical4j
ursjoss Oct 5, 2024
2a83989
au.com.trgtd.tr.prefs.actions
ursjoss Oct 5, 2024
33920f3
au.com.trgtd.tr.prefs.projects
ursjoss Oct 5, 2024
330c06b
au.com.trgtd.tr.prefs.recurrence
ursjoss Oct 5, 2024
d84690e
tr.model
ursjoss Oct 5, 2024
e09279a
au.com.trgtd.tr.datastore
ursjoss Oct 5, 2024
e3269aa
au.com.trgtd.tr.prefs.data
ursjoss Oct 5, 2024
235dc30
au.com.trgtd.tr.datastore.xstream
ursjoss Oct 5, 2024
a7766bd
au.com.trgtd.tr.archive
ursjoss Oct 5, 2024
bd5d0e2
au.com.trgtd.tr.prefs.ui
ursjoss Oct 5, 2024
e76c4b2
au.com.trgtd.tr.task.activiation
ursjoss Oct 5, 2024
72b589a
au.com.trgtd.tr.task.recurrence
ursjoss Oct 5, 2024
27e5d80
au.com.trgtd.tr.data
ursjoss Oct 5, 2024
c74ef7b
au.com.trgtd.tr.services
ursjoss Oct 5, 2024
234bfd3
au.com.trgtd.tr.cal
ursjoss Oct 5, 2024
4a67ef1
au.com.trgtd.tr.calendar.ical.impl
ursjoss Oct 5, 2024
a549a2b
au.com.trgtd.tr.data.recent
ursjoss Oct 5, 2024
e20fc38
au.com.trgtd.tr.email
ursjoss Oct 5, 2024
3c578ec
au.com.trgtd.tr.export
ursjoss Oct 5, 2024
3c99b39
au.com.trgtd.tr.extract
ursjoss Oct 5, 2024
e566c92
au.com.trgtd.tr.export.actions
ursjoss Oct 5, 2024
47b69fe
au.com.trgtd.tr.export.data
ursjoss Oct 5, 2024
6fc9959
au.com.trgtd.tr.export.references
ursjoss Oct 5, 2024
9d91e9c
au.com.trgtd.tr.export.someday
ursjoss Oct 5, 2024
9cc4098
prepare migration of au.com.trgtd.tr.extract.clean - currently broken
ursjoss Oct 5, 2024
6ada3fd
au.com.trgtd.tr.view
ursjoss Oct 5, 2024
2d9596e
au.com.trgtd.tr.view.topics
ursjoss Oct 5, 2024
de2dd05
au.com.trgtd.tr.view.contexts
ursjoss Oct 5, 2024
c662a5c
au.com.trgtd.tr.view.criteria
ursjoss Oct 5, 2024
7c458cf
au.com.trgtd.tr.view.project
ursjoss Oct 5, 2024
2d99665
au.com.trgtd.tr.view.actn
ursjoss Oct 5, 2024
c4fd5c1
au.com.trgtd.tr.view.goals
ursjoss Oct 5, 2024
deb2ebf
tr.extract.reports
ursjoss Oct 5, 2024
ffa1251
au.com.trgtd.tr.report.project.detail
ursjoss Oct 5, 2024
f61b3a2
au.com.trgtd.tr.report.project.outline
ursjoss Oct 5, 2024
935ebe7
au.com.trgtd.tr.view.filters
ursjoss Oct 5, 2024
5ffe9c8
au.com.trgtd.tr.view.someday
ursjoss Oct 5, 2024
f60b522
au.com.trgtd.tr.view.process
ursjoss Oct 5, 2024
a28c09a
au.com.trgtd.tr.view.reference
ursjoss Oct 5, 2024
e307280
au.com.trgtd.tr.view.collect
ursjoss Oct 5, 2024
e6e4930
au.com.trgtd.tr.find
ursjoss Oct 5, 2024
4242ea5
au.com.trgtd.tr.view.actns
ursjoss Oct 5, 2024
62981d2
au.com.trgtd.tr.view.overview
ursjoss Oct 5, 2024
c1ce839
au.com.trgtd.tr.view.delegates
ursjoss Oct 5, 2024
6c5a3c4
au.com.trgtd.tr.view.calendar
ursjoss Oct 5, 2024
08f52ae
au.com.trgtd.tr.updates
ursjoss Oct 5, 2024
ef7eda5
au.com.trgtd.tr.task.messages
ursjoss Oct 5, 2024
c5358fe
au.com.trgtd.tr.reports.weekly
ursjoss Oct 5, 2024
3177982
au.com.trgtd.tr.reports.someday
ursjoss Oct 5, 2024
0e0ffd2
au.com.trgtd.tr.reports.reference
ursjoss Oct 5, 2024
5f54402
au.com.trgtd.tr.reports.pocketmod
ursjoss Oct 5, 2024
5db2919
au.com.trgtd.tr.reports.done
ursjoss Oct 5, 2024
c5b1287
au.com.trgtd.tr.reports.actions.scheduled
ursjoss Oct 5, 2024
9b2c7cb
au.com.trgtd.tr.reports.actions.doasap
ursjoss Oct 5, 2024
b8379b5
au.com.trgtd.tr.reports.actions.delegated
ursjoss Oct 5, 2024
ed0da85
au.com.trgtd.tr.reports.sa
ursjoss Oct 5, 2024
05a3b7d
au.com.trgtd.tr.report.projects.future
ursjoss Oct 5, 2024
2653531
au.com.trgtd.tr.sync.device
ursjoss Oct 5, 2024
d483559
au.com.trgtd.tr.sync.iphone
ursjoss Oct 5, 2024
ee065d8
au.com.trgtd.tr.l10n.{de_DE,en_US,es_ES,fr_FR,nl_NL}
ursjoss Oct 5, 2024
708b959
au.com.trgtd.tr.i18n
ursjoss Oct 5, 2024
34c6f41
au.com.trgtd.tr.imports and .thoughts
ursjoss Oct 5, 2024
c69e224
tr.extract.reports.projectoutline and .projectdetails
ursjoss Oct 5, 2024
fa81e45
sort modules in settings.gradle.kts
ursjoss Oct 6, 2024
8d7ff6c
update justfile to use gradle build where feasible
ursjoss Oct 6, 2024
d7b8944
format build.gradle.kts
ursjoss Oct 6, 2024
cf947a1
ignore test that breaks with java 21 and probably is not really a spec
ursjoss Oct 6, 2024
f75f232
Update github action to
ursjoss Oct 6, 2024
6360354
Purposely introduce a failing test to validate CI will fail
ursjoss Oct 6, 2024
7e7a78f
Revert "Purposely introduce a failing test to validate CI will fail"
ursjoss Oct 6, 2024
ca78798
Restore expectations of now commented out tests of OverviewSVGProviders
ursjoss Oct 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,28 @@ on:

jobs:
build:
strategy:
matrix:
jdk: [17,21]
runs-on: ubuntu-latest
env:
JDK_VERSION: ${{ matrix.jdk }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache netbeans platform
uses: actions/cache@v3
env:
cache-name: netbeans-plat
with:
path: netbeans-plat
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('nbproject/platform.properties') }}
- name: Gradle wrapper validation
uses: gradle/actions/wrapper-validation@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
java-version: ${{ matrix.jdk }}
cache: gradle

- name: Install just
uses: taiki-e/install-action@just
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ netbeans-plat/
.idea/
**/*.iml

.gradle
96 changes: 96 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
plugins {
java
alias(libs.plugins.download)
}

private val netbeansVersion = libs.versions.netbeans.ide.get()

java {
toolchain {
languageVersion = JavaLanguageVersion.of(libs.versions.java.get())
}
}

subprojects {
apply(plugin = "java")

repositories {
mavenCentral()

maven {
url = uri("https://netbeans.apidesign.org/maven2")
}
}

dependencies {
//implementation(platform(rootProject.libs.netbeans.cluster.platform))
RadekCap marked this conversation as resolved.
Show resolved Hide resolved
//implementation(platform(rootProject.libs.netbeans.cluster.harness))
//
//runtimeOnly(libs.netbeans.cluster.platform)
//implementation(libs.netbeans.api.core.multitabs)

runtimeOnly(rootProject.libs.netbeans.modules.projectapi.nb)
runtimeOnly(rootProject.libs.netbeans.modules.core.multitabs.project)
runtimeOnly(rootProject.libs.netbeans.modules.core.windows)

testImplementation(rootProject.libs.junit.jupiter)
testImplementation(rootProject.libs.junit4)
testRuntimeOnly(rootProject.libs.junit.vintage.engine)
}

tasks.named<Test>("test") {
useJUnitPlatform()
}

tasks.withType<Jar>().configureEach {
manifest {
from("${project.projectDir}/manifest.mf")
}
}
}


tasks {
val downloadNetBeans = register("downloadNetBeans") {
description = "Ensures netbeans-$netbeansVersion-bin.zip has been downloaded to the build directory"
group = "prepare"

doLast {
download.run {
src("https://archive.apache.org/dist/netbeans/netbeans/$netbeansVersion/netbeans-$netbeansVersion-bin.zip")
dest(layout.buildDirectory)
overwrite(true)
onlyIfModified(true)
}
}
}
register<Copy>("unpackNetBeans") {
description =
"Ensures the required netbeans-$netbeansVersion modules have been extracted to the netbeans-plat directory"
group = "prepare"

val netbeansZip = zipTree(file(layout.buildDirectory).resolve("netbeans-$netbeansVersion-bin.zip"))
val netbeansDir = file("./netbeans-plat/$netbeansVersion/").also {
it.mkdirs()
}

from(netbeansZip)
into(netbeansDir)

eachFile {
relativePath = RelativePath(true, *relativePath.segments.drop(1).toTypedArray())
}

include("netbeans/platform/**", "netbeans/harness/**", "netbeans/ide/**")
exclude("netbeans/platform/docs/**")

inputs.files(downloadNetBeans)
outputs.dir(netbeansDir)

includeEmptyDirs = false

doFirst {
file(layout.buildDirectory).mkdirs()
}
}
}
5 changes: 5 additions & 0 deletions gradle-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
val buildTask = tasks.register("buildPlugins")

subprojects {
buildTask.configure { dependsOn(tasks.named("build")) }
}
26 changes: 26 additions & 0 deletions gradle-plugins/migration/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
`java-gradle-plugin`
`kotlin-dsl`
}

dependencies {
implementation(libs.plugin.kotlin)
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
}
}

gradlePlugin {
plugins {
create("antPathSourcSetPlugin") {
id = "au.com.trgtd.migration.antpathsourceset"
implementationClass = "au.com.trgtd.migration.AntPathSourceSetPlugin"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package au.com.trgtd.migration

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.getByType

@Suppress("unused", "UnstableApiUsage")
/**
* Plugin configuring gradle to expect main/test/resource source sets
* as they are found in the ant configured project. Thus, we can build
* up a gradle project in parallel to the still used ant-setup, profiting
* from gradle for the CI build.
*
* The target will eventually be to move the files to a more gradle-style
* directory layout.
*/
class AntPathSourceSetPlugin : Plugin<Project> {
override fun apply(project: Project): Unit = with(project) {
apply<JavaPlugin>()

val sourceSets = extensions.getByType<SourceSetContainer>()

sourceSets.named(SourceSet.MAIN_SOURCE_SET_NAME) {
java.setSrcDirs(listOf(MAIN_SRC_SET))
resources.setSrcDirs(listOf(MAIN_SRC_SET))
}
sourceSets.named(SourceSet.TEST_SOURCE_SET_NAME) {
java.setSrcDirs(listOf(TEST_SRC_SET))
resources.setSrcDirs(listOf(TEST_SRC_SET))
}
}

companion object {
private const val MAIN_SRC_SET = "src"
private const val TEST_SRC_SET = "test/unit/src"
}
}
21 changes: 21 additions & 0 deletions gradle-plugins/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}

@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
}
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}

include("migration")
77 changes: 77 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[versions]
apache-commons-email = "1.6.0"
apache-commons-lang3 = "3.12.0"
apache-commons-text = "1.12.0"
batik = "1.6-1"
ddmlib = "22.5.3"
download-plugin = "5.6.0"
fop = "0.95-1"
glazedlists = "1.11.0"
ical4j = "1.0.5.2"
itext = "2.1.7"
jackson-databind = "2.2.3"
jasperreports = "5.1.0"
java = "17"
javax-mail = "1.4.7"
jaxb-api = "2.3.0"
jmdns = "3.4.2-r353-1"
junit-jupiter = "5.10.1"
junit4 = "4.13.2"
kotlin = "2.0.20"
miglayout-swing = "4.1"
minimal-json = "0.9.4"
netbeans-ide = "22"
netbeans-api = "RELEASE220"
netbeans-ext-swing = "RELEASE802"
super-csv = "2.4.0"
swingx = "1.6.5-1"
xstream = "1.4.19"

[libraries]
apache-commons-email = { module = "org.apache.commons:commons-email", version.ref = "apache-commons-email" }
apache-commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "apache-commons-lang3" }
apache-commons-text = { module = "org.apache.commons:commons-text", version.ref = "apache-commons-text" }
batik-swing = { module = "batik:batik-swing", version.ref = "batik" }
ddmlib = { module = "com.android.tools.ddms:ddmlib", version.ref = "ddmlib" }
fop = { module = "org.apache.xmlgraphics:fop", version.ref = "fop" }
glazedlists = { module = "com.glazedlists:glazedlists", version.ref = "glazedlists" }
ical4j = { module = "org.mnode.ical4j:ical4j", version.ref = "ical4j" }
itext = { module = "com.lowagie:itext", version.ref = "itext" }
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson-databind" }
jasperreports = { module = "net.sf.jasperreports:jasperreports", version.ref = "jasperreports" }
javax-mail = { module = "javax.mail:mail", version.ref = "javax-mail" }
jaxb-api = { module = "javax.xml.bind:jaxb-api", version.ref = "jaxb-api" }
jmdns = { module = "com.github.rickyclarkson:jmdns", version.ref = "jmdns" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "junit-jupiter" }
junit4 = { module = "junit:junit", version.ref = "junit4" }
miglayout-swing = { module = "com.miglayout:miglayout-swing", version.ref = "miglayout-swing" }
minimaljson = { module = "com.eclipsesource.minimal-json:minimal-json", version.ref = "minimal-json" }
netbeans-api-progress = { module = "org.netbeans.api:org-netbeans-api-progress", version.ref = "netbeans-api" }
netbeans-api-core-multitabs = { module = "org.netbeans.api:org-netbeans-core-multitabs", version.ref = "netbeans-api" }
netbeans-api-jdesktop-layout = { module = "org.netbeans.api:org-jdesktop-layout", version.ref = "netbeans-ext-swing" }
netbeans-api-modules-javahelp = { module = "org.netbeans.api:org-netbeans-modules-javahelp", version.ref = "netbeans-api" }
netbeans-api-modules-netbinox = { module = "org.netbeans.api:org-netbeans-modules-netbinox", version.ref = "netbeans-api" }
netbeans-api-modules-options-api = { module = "org.netbeans.api:org-netbeans-modules-options-api", version.ref = "netbeans-api" }
netbeans-api-openide-awt = { module = "org.netbeans.api:org-openide-awt", version.ref = "netbeans-api" }
netbeans-api-openide-dialogs = { module = "org.netbeans.api:org-openide-dialogs", version.ref = "netbeans-api" }
netbeans-api-openide-filesystems = { module = "org.netbeans.api:org-openide-filesystems", version.ref = "netbeans-api" }
netbeans-api-openide-filesystems-compat8 = { module = "org.netbeans.api:org-openide-filesystems-compat8", version.ref = "netbeans-api" }
netbeans-api-openide-nodes = { module = "org.netbeans.api:org-openide-nodes", version.ref = "netbeans-api" }
netbeans-api-openide-util = { module = "org.netbeans.api:org-openide-util", version.ref = "netbeans-api" }
netbeans-api-openide-util-ui = { module = "org.netbeans.api:org-openide-util-ui", version.ref = "netbeans-api" }
netbeans-api-openide-windows = { module = "org.netbeans.api:org-openide-windows", version.ref = "netbeans-api" }
netbeans-cluster-harness = { module = "org.netbeans.cluster:harness", version.ref = "netbeans-api" }
netbeans-cluster-platform = { module = "org.netbeans.cluster:platform", version.ref = "netbeans-api" }
netbeans-modules-ide-kit = { module = "org.netbeans.modules:org-netbeans-modules-ide-kit", version.ref = "netbeans-api" }
netbeans-modules-core-multitabs-project = { module = "org.netbeans.modules:org-netbeans-core-multitabs-project", version.ref = "netbeans-api" }
netbeans-modules-core-windows = { module = "org.netbeans.modules:org-netbeans-core-windows", version.ref = "netbeans-api" }
netbeans-modules-projectapi-nb = { module = "org.netbeans.modules:org-netbeans-modules-projectapi-nb", version.ref = "netbeans-api" }
supercsv = { module = "net.sf.supercsv:super-csv", version.ref = "super-csv" }
swingx = { module = "org.swinglabs.swingx:swingx-core", version.ref = "swingx" }
xstream = { module = "com.thoughtworks.xstream:xstream", version.ref = "xstream" }

plugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }

[plugins]
download = { id = "de.undercouch.download", version.ref = "download-plugin" }
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading