diff --git a/pretixscan/build.gradle b/pretixscan/build.gradle index de9df4a..b7f7628 100644 --- a/pretixscan/build.gradle +++ b/pretixscan/build.gradle @@ -1,19 +1,3 @@ -group 'eu.pretix.pretixscan' -version = project.properties['version'] -project.version version - -import org.gradle.internal.os.OperatingSystem -apply from: 'libpretixsync-repo/libpretixsync/versions.gradle' - -ext { - operatingSystem = OperatingSystem.current() -} - -repositories { - jcenter() - mavenCentral() -} - buildscript { repositories { jcenter() @@ -27,14 +11,29 @@ buildscript { classpath "net.ltgt.gradle:gradle-apt-plugin:0.17" classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.8.2' classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1' - classpath 'org.openjfx:javafx-plugin:0.0.7' } } +plugins { + id 'application' + id 'org.jetbrains.kotlin.jvm' version '1.9.23' apply false + id 'org.jetbrains.kotlin.kapt' version '1.9.23' apply false +} + +group 'eu.pretix.pretixscan' +version = project.properties['version'] +project.version version + +import org.gradle.internal.os.OperatingSystem +apply from: 'libpretixsync-repo/libpretixsync/versions.gradle' -apply plugin: 'base' -apply plugin: 'kotlin' -apply plugin: 'kotlin-kapt' -apply plugin: 'net.ltgt.apt-idea' +ext { + operatingSystem = OperatingSystem.current() +} + +repositories { + jcenter() + mavenCentral() +} subprojects { apply plugin: 'java' diff --git a/pretixscan/gradle/wrapper/gradle-wrapper.jar b/pretixscan/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf..62d4c05 100644 Binary files a/pretixscan/gradle/wrapper/gradle-wrapper.jar and b/pretixscan/gradle/wrapper/gradle-wrapper.jar differ diff --git a/pretixscan/gradle/wrapper/gradle-wrapper.properties b/pretixscan/gradle/wrapper/gradle-wrapper.properties index 622ab64..17655d0 100644 --- a/pretixscan/gradle/wrapper/gradle-wrapper.properties +++ b/pretixscan/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/pretixscan/gradlew b/pretixscan/gradlew index 8e25e6c..fbd7c51 100755 --- a/pretixscan/gradlew +++ b/pretixscan/gradlew @@ -82,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -125,10 +126,11 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath @@ -154,19 +156,19 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,14 +177,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/pretixscan/gradlew.bat b/pretixscan/gradlew.bat index 24467a1..a9f778a 100644 --- a/pretixscan/gradlew.bat +++ b/pretixscan/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @@ -81,6 +84,7 @@ set CMD_LINE_ARGS=%* set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% diff --git a/pretixscan/gui/build.gradle b/pretixscan/gui/build.gradle index 5f4a85e..b3ea945 100644 --- a/pretixscan/gui/build.gradle +++ b/pretixscan/gui/build.gradle @@ -3,8 +3,10 @@ */ import org.apache.tools.ant.filters.* -apply plugin: 'application' -apply plugin: 'org.openjfx.javafxplugin' +plugins { + id 'application' + id 'org.openjfx.javafxplugin' version '0.1.0' +} apply from: '../libpretixsync-repo/libpretixsync/versions.gradle' mainClassName = "eu.pretix.pretixscan.desktop.PretixScanMain" @@ -71,15 +73,15 @@ dependencies { implementation(project(':libpretixprint')) { transitive = false } - testCompile group: 'junit', name: 'junit', version: '4.12' + testImplementation group: 'junit', name: 'junit', version: '4.12' - javafxCompile "org.openjfx:javafx-base:11.0.2:${platform}" - javafxCompile "org.openjfx:javafx-graphics:11.0.2:${platform}" - javafxCompile "org.openjfx:javafx-controls:11.0.2:${platform}" - javafxCompile "org.openjfx:javafx-fxml:11.0.2:${platform}" - javafxCompile "org.openjfx:javafx-swing:11.0.2:${platform}" + implementation "org.openjfx:javafx-base:11.0.2:${platform}" + implementation "org.openjfx:javafx-graphics:11.0.2:${platform}" + implementation "org.openjfx:javafx-controls:11.0.2:${platform}" + implementation "org.openjfx:javafx-fxml:11.0.2:${platform}" + implementation "org.openjfx:javafx-swing:11.0.2:${platform}" - compileOnly configurations.javafxCompile + //compileOnly configurations.javafxCompile } tasks.withType(JavaCompile) { @@ -107,5 +109,6 @@ javafx { modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.graphics', 'javafx.swing' ] + configurations = [ 'implementation', 'testImplementation' ] version = '11.0.2' } \ No newline at end of file diff --git a/pretixscan/gui/src/main/kotlin/eu/pretix/pretixscan/desktop/PrintUtils.kt b/pretixscan/gui/src/main/kotlin/eu/pretix/pretixscan/desktop/PrintUtils.kt index 291b28a..5be6809 100644 --- a/pretixscan/gui/src/main/kotlin/eu/pretix/pretixscan/desktop/PrintUtils.kt +++ b/pretixscan/gui/src/main/kotlin/eu/pretix/pretixscan/desktop/PrintUtils.kt @@ -54,21 +54,10 @@ fun getBadgeLayout(application: PretixScanMain, position: JSONObject, eventSlug: } } - /* Legacy mechanism: Keep around until pretix 2.5 is end of life */ - val item = application.data().select(Item::class.java) - .where(Item.SERVER_ID.eq(itemid_server)) - .get().firstOrNull() ?: return getDefaultBadgeLayout() - if (item.getBadge_layout_id() != null) { - return application.data().select(BadgeLayout::class.java) - .where(BadgeLayout.SERVER_ID.eq(item.getBadge_layout_id())) - .and(BadgeLayout.EVENT_SLUG.eq(eventSlug)) - .get().firstOrNull() ?: getDefaultBadgeLayout() - } else { // Also used for current pretix versions for obtaining the event's default badge layout - return application.data().select(BadgeLayout::class.java) - .where(BadgeLayout.IS_DEFAULT.eq(true)) - .and(BadgeLayout.EVENT_SLUG.eq(eventSlug)) - .get().firstOrNull() ?: getDefaultBadgeLayout() - } + return application.data().select(BadgeLayout::class.java) + .where(BadgeLayout.IS_DEFAULT.eq(true)) + .and(BadgeLayout.EVENT_SLUG.eq(eventSlug)) + .get().firstOrNull() ?: getDefaultBadgeLayout() } fun printBadge(application: PretixScanMain, position: JSONObject, eventSlug: String) { diff --git a/pretixscan/libpretixprint-repo b/pretixscan/libpretixprint-repo index 705df7f..1626c60 160000 --- a/pretixscan/libpretixprint-repo +++ b/pretixscan/libpretixprint-repo @@ -1 +1 @@ -Subproject commit 705df7feb790aa33a5512fd93ae3bdc6a96d7327 +Subproject commit 1626c60e1f1d7b8ea21fbc035cc0e3de04732303 diff --git a/pretixscan/libpretixsync-repo b/pretixscan/libpretixsync-repo index bfd2af6..2b14dac 160000 --- a/pretixscan/libpretixsync-repo +++ b/pretixscan/libpretixsync-repo @@ -1 +1 @@ -Subproject commit bfd2af62ab8455dd2acdf0d5930db5e9ed8b44cb +Subproject commit 2b14dac13d4fd6e35171f0e01b3e3298dadf97f0 diff --git a/pretixscan/packaging/build.gradle b/pretixscan/packaging/build.gradle index 11d852c..3147982 100644 --- a/pretixscan/packaging/build.gradle +++ b/pretixscan/packaging/build.gradle @@ -49,11 +49,11 @@ task recreateIcons(dependsOn: [recreateIconMacApp, recreateIconWindowsApp]) { } dependencies { - compile project(':gui') + implementation project(':gui') } task copyDependencies(type: Copy) { - from configurations.runtime + //from configurations.runtime into "${buildDir}/libraries" }