Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
121 changes: 121 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,95 @@
# Created by https://www.toptal.com/developers/gitignore/api/intellij+all,java,gradle
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij+all,java,gradle

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.

.idea/*

!.idea/codeStyles
!.idea/runConfigurations

### Java ###
# Compiled class file
*.class

Expand All @@ -22,3 +114,32 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

### Gradle ###
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

### Gradle Patch ###
# Java heap dump
*.hprof

# End of https://www.toptal.com/developers/gitignore/api/intellij+all,java,gradle
4 changes: 4 additions & 0 deletions build-logic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# JabRef build logic

This directory contains gradle instructions for the build.
Initially, it was created by `gradle init` using gradle 8.13.
18 changes: 18 additions & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins {
`kotlin-dsl`
}

repositories {
gradlePluginPortal()
}

dependencies {
implementation("com.adarshr:gradle-test-logger-plugin:4.0.0")
implementation("com.github.andygoossens:gradle-modernizer-plugin:1.12.0")
implementation("org.gradlex:extra-java-module-info:1.13.1")
implementation("org.gradlex:java-module-dependencies:1.11")
implementation("org.gradlex:java-module-packaging:1.2")
implementation("org.gradlex:java-module-testing:1.8")
implementation("org.gradlex:jvm-dependency-conflict-resolution:2.4")
implementation("org.gradle.toolchains:foojay-resolver:1.0.0")
}
1 change: 1 addition & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = "build-logic"
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
plugins {
id("org.gradlex.extra-java-module-info")
id("org.gradlex.jvm-dependency-conflict-resolution")
id("org.gradlex.java-module-dependencies") // only for mappings at the moment
}

javaModuleDependencies {
// TODO remove to translate 'requires' from 'module-info.java' to Gradle dependencies
// and remove 'dependencies {}' block from build.gradle files
analyseOnly = true // makes no difference
}

jvmDependencyConflicts {
consistentResolution {
platform(":versions")
}
}

// Tell gradle which jar to use for which platform
// Source: https://github.com/jjohannes/java-module-system/blob/be19f6c088dca511b6d9a7487dacf0b715dbadc1/gradle/plugins/src/main/kotlin/metadata-patch.gradle.kts#L14-L22
jvmDependencyConflicts.patch {
listOf(
"base",
).forEach { jfxModule ->
module(
"org.openjfx:javafx-$jfxModule"
) {
addTargetPlatformVariant(
"",
"none",
"none"
) // matches the empty Jars: to get better errors
addTargetPlatformVariant(
"linux",
OperatingSystemFamily.LINUX,
MachineArchitecture.X86_64
)
addTargetPlatformVariant(
"linux-aarch64",
OperatingSystemFamily.LINUX,
MachineArchitecture.ARM64
)
addTargetPlatformVariant(
"mac",
OperatingSystemFamily.MACOS,
MachineArchitecture.X86_64
)
addTargetPlatformVariant(
"mac-aarch64",
OperatingSystemFamily.MACOS,
MachineArchitecture.ARM64
)
addTargetPlatformVariant(
"win",
OperatingSystemFamily.WINDOWS,
MachineArchitecture.X86_64
)
}
}
}
extraJavaModuleInfo {
failOnAutomaticModules = true
failOnModifiedDerivedModuleNames = true
skipLocalJars = true

module("org.openjfx:javafx-base", "javafx.base") {
patchRealModule()
exportAllPackages()
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repositories {
mavenCentral()

maven { url = uri("https://central.sonatype.com/repository/maven-snapshots/") }

// Required for https://github.com/sialcasa/mvvmFX
maven { url = uri("https://jitpack.io") }

// Required for one.jpro.jproutils:tree-showing
maven { url = uri("https://sandec.jfrog.io/artifactory/repo") }

maven { url = rootDir.resolve("jablib/lib").toURI() }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention")
id("org.gradlex.java-module-dependencies")
}

// https://github.com/gradlex-org/java-module-dependencies#plugin-dependency
includeBuild(".")
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
plugins {
id("java")
}

java {
toolchain {
// If this is updated, also update
// - build.gradle -> jacoco -> toolVersion (because JaCoCo does not support newest JDK out of the box. Check versions at https://www.jacoco.org/jacoco/trunk/doc/changes.html)
// - jitpack.yml
// - .sdkmanrc
// - .devcontainer/devcontainer.json#L34 - there, also check if the gradleVersion matches the one of gradle/wrapper/gradle-wrapper.properties
// - .moderne/moderne.yml
// - .github/workflows/binaries*.yml
// - .github/workflows/publish.yml
// - .github/workflows/tests*.yml
// - .github/workflows/update-gradle-wrapper.yml
// - .jbang/Jab*.java
// - docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-12-build.md
// - jablib-examples/jbang/*.java
// - jablib-examples/maven3/*/pom.xml
languageVersion = JavaLanguageVersion.of(24)
// See https://docs.gradle.org/current/javadoc/org/gradle/jvm/toolchain/JvmVendorSpec.html for a full list
// Temurin does not ship jmods, thus we need to use another JDK -- see https://github.com/actions/setup-java/issues/804
// We also need a JDK without JavaFX, because we patch JavaFX due to modularity issues
vendor = JvmVendorSpec.AMAZON
}
}

tasks.withType<JavaCompile>().configureEach {
options.release = 24
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import com.adarshr.gradle.testlogger.theme.ThemeType

plugins {
id("java")
id("org.gradlex.java-module-testing")
// Hint from https://stackoverflow.com/a/46533151/873282
id("com.adarshr.test-logger")
}

testing {
@Suppress("UnstableApiUsage")
suites.named<JvmTestSuite>("test") {
useJUnitJupiter()
}
}

tasks.withType<Test>().configureEach {
// Enable parallel tests (on desktop).
// See https://docs.gradle.org/8.1/userguide/performance.html#execute_tests_in_parallel for details.
if (!providers.environmentVariable("CI").isPresent) {
maxParallelForks = maxOf(Runtime.getRuntime().availableProcessors() - 1, 1)
}
}

testlogger {
// See https://github.com/radarsh/gradle-test-logger-plugin#configuration for configuration options

theme = ThemeType.STANDARD

showPassed = false
showSkipped = false

showCauses = true
showStackTraces = true
}

configurations.testCompileOnly {
extendsFrom(configurations.compileOnly.get())
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins {
id("java")
id("project-report")
id("org.jabref.javafx.controls.gradle.base.dependency-rules")
id("org.jabref.javafx.controls.gradle.base.repositories")
id("org.jabref.javafx.controls.gradle.feature.compile")
id("org.jabref.javafx.controls.gradle.feature.test")
}
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins {
id("org.jabref.javafx.controls.gradle.base.repositories")
id("org.jabref.javafx.controls.gradle.feature.compile")
}
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-9.2.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading