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
9 changes: 2 additions & 7 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,18 @@ install:
- SET PATH=C:\Program Files\OpenJDK\jdk-11.0.2\bin;%PATH%
- curl -o jdk.packager-windows.zip http://download2.gluonhq.com/jpackager/11/jdk.packager-windows.zip
- 7z e jdk.packager-windows.zip
- curl -o jmods.zip https://download2.gluonhq.com/openjfx/11.0.2/openjfx-11.0.2_windows-x64_bin-jmods.zip
- curl -o jmods.zip https://download2.gluonhq.com/openjfx/17.0.11/openjfx-17.0.11_windows-x64_bin-jmods.zip
- 7z x jmods.zip
- mv jpackager.exe "%JAVA_HOME%\bin"
- mv jdk.packager.jar "%JAVA_HOME%\jmods"
- curl -o mvn.zip https://downloads.apache.org/maven/maven-3/3.9.4/binaries/apache-maven-3.9.4-bin.zip
- 7z x mvn.zip
- cd pretixscan\tornadofx-repo
- ..\..\apache-maven-3.9.4\bin\mvn package
- cd ..\..

cache:
- '%USERPROFILE%\.gradle -> appveyor.yml'

test_script:
- cd pretixscan
- gradlew --no-daemon -version
- gradlew --no-daemon --stacktrace clean createBundle -PjavafxJmodsPath=../../javafx-jmods-11.0.2/
- gradlew --no-daemon --stacktrace clean createBundle -PjavafxJmodsPath=../../javafx-jmods-17.0.11/
- mkdir dist
- '"C:\Program Files (x86)\NSIS\makensis.exe" packaging\build\resources\main\windows.nsi'

Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
cache: 'gradle'

- name: Build with Gradle
working-directory: pretixscan
run: TERM=dumb ./gradlew clean check test build
11 changes: 4 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@ variables:
GIT_SUBMODULE_STRATEGY: "recursive"
package:
before_script:
- apt update && apt -y install fakeroot maven
- wget https://download2.gluonhq.com/openjfx/11.0.2/openjfx-11.0.2_linux-x64_bin-jmods.zip
- unzip openjfx-11.0.2_linux-x64_bin-jmods.zip
- apt update && apt -y install fakeroot
- wget https://download2.gluonhq.com/openjfx/17.0.11/openjfx-17.0.11_linux-x64_bin-jmods.zip
- unzip openjfx-17.0.11_linux-x64_bin-jmods.zip
- wget https://download2.gluonhq.com/jpackager/11/jdk.packager-linux.zip
- unzip jdk.packager-linux.zip
- cd pretixscan/tornadofx-repo
- mvn -DskipTests package
- cd ../..
script:
- cd pretixscan
- ./gradlew clean createBundle -PjavafxJmodsPath=../../javafx-jmods-11.0.2/ -PjavaPackagerPath=../../
- ./gradlew clean createBundle -PjavafxJmodsPath=../../javafx-jmods-17.0.11/ -PjavaPackagerPath=../../
artifacts:
expire_in: 14 days
paths:
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
url = https://github.com/pretix/libpretixprint.git
[submodule "pretixscan/tornadofx-repo"]
path = pretixscan/tornadofx-repo
url = https://github.com/edvin/tornadofx.git
url = https://github.com/pretix-unofficial/tornadofx.git
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

18 changes: 6 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
pretixSCAN
==========

.. image:: https://travis-ci.org/pretix/pretixscan-desktop.svg?branch=master
:target: https://travis-ci.org/pretix/pretixscan-desktop

.. image:: https://ci.appveyor.com/api/projects/status/n3n5tp3wl3i2qg5p?svg=true
:target: https://ci.appveyor.com/project/raphaelm/pretixscan-desktop
:target: https://ci.appveyor.com/project/raphaelm/pretixdesk

Checking in your attendees, one ticket at a time.

Expand All @@ -24,19 +21,17 @@ use it, but do have a backup plan.
Building and Running
--------------------

This project contains a submodule, so the first command you execute should be::
This project contains submodules, so the first command you execute should be::

git submodule update --init

This project is built using Gradle. It requires a JDK in version 11.
You can then build and run the project using::

cd pretixscan/tornadofx-repo
JAVA_HOME=/usr/lib/jvm/java-11-jdk mvn -DskipTests package
cd ..
cd pretixscan
JAVA_HOME=/usr/lib/jvm/java-11-jdk ./gradlew :gui:run

To create packages, see PACKAGES.md.
To create packages, see PACKAGING.md.

FAQ
---
Expand All @@ -54,7 +49,7 @@ as well, but `tornadofx`_ has a nice Kotlin abstraction and
`JFoenix`_ has nice material-design elements.

Additionally, with the choice of a JVM-based language we can reuse lots of code from our
`pretixdroid`_ Android application, making it easier to
`pretixscan`_ Android application, making it easier to
bring new features to both platforms.

**Why not just a web app?**
Expand Down Expand Up @@ -97,5 +92,4 @@ go to `pretix.eu`_ or contact Raphael directly.
.. _Kotlin: https://kotlinlang.org/
.. _tornadofx: https://github.com/edvin/tornadofx
.. _JFoenix: https://github.com/jfoenixadmin/JFoenix
.. _pretixdroid: https://github.com/pretix/pretixdroid
.. _pretixscan-git: https://aur.archlinux.org/packages/pretixscan-git/
.. _pretixscan: https://github.com/pretix/pretixscan-android
30 changes: 6 additions & 24 deletions pretixscan/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
buildscript {
repositories {
jcenter()
gradlePluginPortal()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31"
classpath "net.ltgt.gradle:gradle-apt-plugin:0.17"
// shorter plugin syntax is not yet ready - https://github.com/FibreFoX/javafx-gradle-plugin/issues/69
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'
}
}
plugins {
Expand All @@ -31,37 +26,24 @@ ext {
}

repositories {
jcenter()
mavenCentral()
}

subprojects {
apply plugin: 'java'
apply plugin: 'kotlin'

sourceCompatibility = 1.8
sourceCompatibility = JavaVersion.VERSION_11

repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}

compileKotlin {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

kotlinOptions {
jvmTarget = "1.8"
apiVersion = "1.5"
languageVersion = "1.5"
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"

Expand Down
108 changes: 73 additions & 35 deletions pretixscan/gui/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
/*
* Open Source Software published under the Apache Licence, Version 2.0.
*/
import org.apache.tools.ant.filters.*
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
id 'application'
id "kotlin"
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'net.nemerosa.versioning' version '2.8.2'
id 'org.beryx.jlink' version '2.26.0'
id 'org.gradlex.extra-java-module-info' version '1.8'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
apply from: '../libpretixsync-repo/libpretixsync/versions.gradle'

mainClassName = "eu.pretix.pretixscan.desktop.PretixScanMain"

applicationName = "pretixSCAN"

ext.buildTimestamp = new Date().format('yyyy-MM-dd HH:mm:ss')

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

extraJavaModuleInfo {
failOnMissingModuleInfo.set(false)
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

processResources {
filesMatching('properties/*.properties') {
filter ReplaceTokens, tokens: [
Expand All @@ -28,6 +46,37 @@ jar {
from(buildDir) {
include 'build-info.properties'
}


}

application {
mainClass = "eu.pretix.pretixscan.desktop.PretixScanMain"
applicationName = "pretixSCAN"
applicationDefaultJvmArgs = [
'--add-modules', 'javafx.controls,javafx.fxml,javafx.graphics,javafx.swing',
'--add-exports', 'javafx.base/com.sun.javafx.runtime=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.css=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.inputmap=ALL-UNNAMED',
"--add-exports", "javafx.base/com.sun.javafx.event=ALL-UNNAMED",
"--add-exports", "javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED",
"--add-exports", "javafx.controls/javafx.scene.control.skin=ALL-UNNAMED",
"--add-exports", "javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED",
"--add-exports", "javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED",
"--add-exports", "javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED",
"--add-exports", "javafx.base/com.sun.javafx.binding=ALL-UNNAMED",
"--add-exports", "javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED",
"--add-exports", "javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED",
"--add-opens", "javafx.controls/javafx.scene.control.skin=ALL-UNNAMED",
"--add-opens", "javafx.graphics/javafx.scene=ALL-UNNAMED",
"--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED",
"--add-opens", "javafx.base/com.sun.javafx.event=ALL-UNNAMED",
"--add-opens", "java.base/java.util=ALL-UNNAMED",
"--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED",
"--add-opens", "java.base/java.text=ALL-UNNAMED",
"--add-opens", "java.desktop/java.awt.font=ALL-UNNAMED",
]
}

def platform
Expand All @@ -41,26 +90,37 @@ if (operatingSystem.isWindows()) {

configurations {
javafxCompile

guiJar {
canBeConsumed = true
canBeResolved = false
extendsFrom implementation, runtimeOnly
}
}

artifacts {
guiJar(jar)
}

javafx {
modules = [
'javafx.controls', 'javafx.fxml', 'javafx.swing'
'javafx.controls', 'javafx.fxml', 'javafx.graphics', 'javafx.swing'
]
version = '11.0.2'
configurations = [ 'implementation', 'testImplementation' ]
version = '17.0.11'
}


dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"

implementation fileTree(dir: '../tornadofx-repo/target', include: ['*.jar'])
implementation(project(':tornadofx'))
implementation "org.xerial:sqlite-jdbc:$sqlite_jdbc_version"
implementation 'net.harawata:appdirs:1.2.1'
implementation 'net.java.dev.jna:platform:3.5.2'
implementation "joda-time:joda-time:$joda_version"
implementation "de.huxhorn.lilith:de.huxhorn.lilith.3rdparty.junique:1.0.4"
implementation 'com.github.kittinunf.fuel:fuel:2.1.0'
implementation 'com.github.kittinunf.fuel:fuel:2.3.1'
implementation 'de.jensd:fontawesomefx-materialicons:2.2.0-9.1.2'
implementation 'com.jfoenix:jfoenix:9.0.9'
implementation 'org.apache.pdfbox:pdfbox:2.0.13'
Expand All @@ -75,40 +135,18 @@ dependencies {
}
testImplementation group: 'junit', name: 'junit', version: '4.12'

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
implementation "org.openjfx:javafx-base:17.0.11:${platform}"
implementation "org.openjfx:javafx-graphics:17.0.11:${platform}"
implementation "org.openjfx:javafx-controls:17.0.11:${platform}"
implementation "org.openjfx:javafx-fxml:17.0.11:${platform}"
implementation "org.openjfx:javafx-swing:17.0.11:${platform}"
}

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.with {
compilerArgs += [
'--module-path', configurations.javafxCompile.asPath,
'--add-modules', 'javafx.controls'
]
}
}

[run, test].each {
it.jvmArgs += [
'--module-path', configurations.javafxCompile.asPath,
'--add-modules', 'javafx.controls,javafx.fxml,javafx.graphics,javafx.swing',
'--add-exports', 'javafx.base/com.sun.javafx.runtime=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.css=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.inputmap=ALL-UNNAMED',
]
}


javafx {
modules = [
'javafx.controls', 'javafx.fxml', 'javafx.graphics', 'javafx.swing'
]
configurations = [ 'implementation', 'testImplementation' ]
version = '11.0.2'
}
Loading