Skip to content

Commit

Permalink
Merge branch 'develop' into allow-tags-in-linux-release
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/release.yml
  • Loading branch information
HEdingfield committed Aug 16, 2023
2 parents 875d3db + 8cbafa4 commit 2d47d57
Show file tree
Hide file tree
Showing 260 changed files with 8,422 additions and 10,125 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ name: "Generate Releases"

on:
release:
types: [published]
# # To test this workflow without creating a release, uncomment the following and add a branch name:
# push:
# branches:
# - 'branch-name'
types: [ published ]
## To test this workflow without creating a release, uncomment the following and add a branch name (making sure "push"
## is at the same indent level as "release":
# push:
# branches:
# - 'branch-name'

jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- name: "Create base filename for all artifacts"
id: basefn
Expand Down Expand Up @@ -57,13 +58,13 @@ jobs:
id: exefn
shell: bash
run: echo "FILEPATH=build/${{ steps.basefn.outputs.FILEPATH }}${{ steps.ext.outputs.EXT }}" >> $GITHUB_OUTPUT

- uses: actions/checkout@v3

- name: "Set up JDK 17.0.2"
- name: "Set up JDK 20.0.1"
uses: actions/setup-java@v3
with:
java-version: '17.0.2'
java-version: '20.0.1'
distribution: 'temurin'

- name: "Validate Gradle wrapper"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: "Set up JDK 17"
- name: "Set up JDK 20.0.1"
uses: actions/setup-java@v2
with:
java-version: '17'
java-version: '20.0.1'
distribution: 'temurin'
- name: "Test with Gradle"
run: ./gradlew check
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,29 @@ The Tabulator includes several example contest configuration files and associate

## Command-Line Interface

Alternatively, you can run the Tabulator using the command-line interface by including the flag `-cli` and then supplying a path to an existing config file, e.g.:
Alternatively, you can run the Tabulator using the command-line interface by including the flag `--cli` and then supplying a path to an existing config file, e.g.:

`$ rcv -cli path/to/config`
`$ rcv --cli path/to/config`

Or, if you're compiling and running using Gradle:

`$ gradlew run --args="-cli path/to/config"`
`$ gradlew run --args="--cli path/to/config"`

You can also activate a special `convert-to-cdf` function via the command line to export the CVR as a NIST common data format (CDF) .json instead of tabulating the results, e.g.:
You can also activate a special `convert-to-cdf` function via the command line to export the CVR as a NIST common data
format (CDF) .json instead of tabulating the results, e.g.:

`$ rcv -cli path/to/config convert-to-cdf`
`$ rcv --cli path/to/config --convert-to-cdf`

This option is available in the GUI by selecting the "Conversion > Convert CVRs in Current Config to CDF" menu option.

Or, again, if you're compiling and running using Gradle:

`$ gradlew run --args="-cli path/to/config convert-to-cdf"`
`$ gradlew run --args="--cli path/to/config --convert-to-cdf"`

Note: if you convert a source to CDF and that source uses an overvoteLabel or an undeclaredWriteInLabel, the label will be represented differently in the generated CDF source file than it was in the original CVR source. When you create a new config using this generated CDF source file and you need to set overvoteLabel, you should use "overvote". If you need to set undeclaredWriteInLabel, you should use "Undeclared Write-ins".
Note: if you convert a source to CDF and that source uses an overvoteLabel or an undeclaredWriteInLabel, the label will
be represented differently in the generated CDF source file than it was in the original CVR source. When you create a
new config using this generated CDF source file and you need to set overvoteLabel, you should use "overvote". If you
need to set undeclaredWriteInLabel, you should use "Undeclared Write-ins".

## Viewing Tabulator Output

Expand Down
131 changes: 81 additions & 50 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,48 @@ plugins {
id "application"
id "checkstyle"
// Latest version at: https://github.com/spotbugs/spotbugs-gradle-plugin/tags
id "com.github.spotbugs" version "5.0.9"
id "com.github.spotbugs" version "5.0.14"
id "idea"
id "java-library"
id "org.beryx.jlink" version "2.25.0"
id "org.openjfx.javafxplugin" version "0.0.11"
// Latest version at: https://github.com/beryx/badass-jlink-plugin/tags
id "org.beryx.jlink" version "2.26.0"
// Latest version at: https://github.com/openjfx/javafx-gradle-plugin/tags
id "org.openjfx.javafxplugin" version "0.0.14"
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.apache.commons:commons-csv:1.9.0'
implementation 'org.apache.poi:poi-ooxml:5.2.2'
implementation 'com.fasterxml.jackson.core:jackson-core:2.13.3'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.3'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.3'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.13.3'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
implementation 'commons-cli:commons-cli:1.5.0'
implementation 'org.apache.commons:commons-csv:1.10.0'
implementation 'org.apache.poi:poi-ooxml:5.2.3'
implementation 'com.fasterxml.jackson.core:jackson-core:2.15.2'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.15.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
}

// ### Application plugin settings
application {
mainModule = "${moduleName}"
mainClass = "${moduleName}.Main"
}

// Uncomment below to simulate running from the CLI
//run {
// standardInput = System.in
// args = ["-cli", "path/to/config"]
//}
// Required to accept a name and tiebreak interactively via CLI
run {
standardInput = System.in
// Uncomment below line to quickly switch into CLI mode for development
// args = ["--cli", "path/to/config"]
}

// ### Checkstyle plugin settings
checkstyle {
// Latest version at https://github.com/checkstyle/checkstyle/tags
toolVersion = '10.3.2'
toolVersion = '10.12.1'
// Keep the below file updated along with subsequent versions of Checkstyle (make sure to choose
// the tag matching the toolVersion above):
// https://github.com/checkstyle/checkstyle/blob/checkstyle-10.3.2/src/main/resources/google_checks.xml
Expand All @@ -58,7 +63,7 @@ System.setProperty("org.checkstyle.google.suppressionfilter.config",

spotbugs {
// Latest version at: https://github.com/spotbugs/spotbugs/tags
toolVersion = '4.7.1'
toolVersion = '4.7.3'
excludeFilter = file("config/spotbugs/exclude.xml")
}

Expand All @@ -72,7 +77,7 @@ idea {
// ### Java plugin settings
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(20))
}
}

Expand All @@ -92,7 +97,8 @@ test {

// ### JavaFX plugin settings
javafx {
version = "18"
// Latest version here: https://gluonhq.com/products/javafx/
version = "20.0.1"
modules = ["javafx.base", "javafx.controls", "javafx.fxml", "javafx.graphics"]
}

Expand All @@ -107,8 +113,8 @@ jlink {
imageDir = file(JLINK_DIR)
imageZip = file(JLINK_DIR + ".zip")
addOptions '--add-modules', MODULES_TO_ADD,
'--strip-debug', '--compress', '2',
'--no-header-files', '--no-man-pages'
'--strip-debug', '--compress', '2',
'--no-header-files', '--no-man-pages'
mergedModule {
requires "java.xml"
}
Expand All @@ -120,53 +126,53 @@ jlink {

jpackage {
installerOptions += [
'--verbose',
'--vendor', 'Ranked Choice Voting Resource Center'
'--verbose',
'--vendor', 'Ranked Choice Voting Resource Center'
]
if (org.gradle.internal.os.OperatingSystem.current().isLinux()) {
imageOptions += [
'--icon', 'src/main/resources/network/brightspots/rcv/launcher.png',
'--icon', 'src/main/resources/network/brightspots/rcv/launcher.png',
]

installerOptions += [
'--linux-package-name', 'rctab',
'--linux-deb-maintainer', '[email protected]',
'--linux-shortcut'
'--linux-package-name', 'rctab',
'--linux-deb-maintainer', '[email protected]',
'--linux-shortcut'
]
}
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
imageOptions += [
'--icon', 'src/main/resources/network/brightspots/rcv/launcher.ico',
'--icon', 'src/main/resources/network/brightspots/rcv/launcher.ico',
]

installerOptions += [
'--win-per-user-install',
'--win-dir-chooser',
'--win-menu',
'--win-shortcut'
'--win-per-user-install',
'--win-dir-chooser',
'--win-menu',
'--win-shortcut'
]
}
if (org.gradle.internal.os.OperatingSystem.current().isMacOsX()) {
// .App is signed with the Application certificate
imageOptions += [
'--icon', 'src/main/resources/network/brightspots/rcv/launcher.icns',
'--resource-dir', 'src/main/resources/network/brightspots/rcv/',
'--mac-sign',
'--mac-signing-key-user-name', 'Developer ID Application: Election Administration Resource Center (A257HB4NS4',
'--mac-signing-keychain', 'build.keychain'
'--icon', 'src/main/resources/network/brightspots/rcv/launcher.icns',
'--resource-dir', 'src/main/resources/network/brightspots/rcv/',
'--mac-sign',
'--mac-signing-key-user-name', 'Developer ID Application: Election Administration Resource Center (A257HB4NS4',
'--mac-signing-keychain', 'build.keychain'
]

// DMG is signed with the Installer certificate
installerOptions += [
'--type', 'dmg',
'--icon', 'src/main/resources/network/brightspots/rcv/launcher.icns',
'--resource-dir', 'src/main/resources/network/brightspots/rcv/',
'--mac-sign',
'--mac-signing-key-user-name', 'Developer ID Installer: Election Administration Resource Center (A257HB4NS4)',
'--mac-signing-keychain', 'build.keychain',
'--mac-package-name', 'RCTab',
'--mac-package-identifier', 'network.brightspots.rcv',
'--mac-package-signing-prefix', 'network.brightspots.rcv'
'--type', 'dmg',
'--icon', 'src/main/resources/network/brightspots/rcv/launcher.icns',
'--resource-dir', 'src/main/resources/network/brightspots/rcv/',
'--mac-sign',
'--mac-signing-key-user-name', 'Developer ID Installer: Election Administration Resource Center (A257HB4NS4)',
'--mac-signing-keychain', 'build.keychain',
'--mac-package-name', 'RCTab',
'--mac-package-identifier', 'network.brightspots.rcv',
'--mac-package-signing-prefix', 'network.brightspots.rcv'
]
}
}
Expand All @@ -181,14 +187,39 @@ def docsToCopy = copySpec {
def sampleInputToCopy = copySpec {
includeEmptyDirs = false
from("$projectDir/src/test/resources/network/brightspots/rcv/test_data") {
include "2015_portland_mayor/2015_portland_mayor_config.json"
include "2015_portland_mayor/2015_portland_mayor_cvr.xlsx"
// Config example: interactive tiebreaking
include "sample_interactive_tiebreak/sample_interactive_tiebreak_config.json"
include "sample_interactive_tiebreak/sample_interactive_tiebreak_sequential_config.json"
include "sample_interactive_tiebreak/sample_interactive_tiebreak_cvr.xlsx"

// Config example: by-precinct
include "precinct_example/precinct_example_config.json"
include "precinct_example/precinct_example_cvr.xlsx"
include "dominion_cvr_conversion_alaska/*.json"

// CVR example: CDF
include "aliases_cdf_json/aliases_cdf_json_config.json"
include "aliases_cdf_json/aliases_cdf_json_expected_summary.csv"

// CVR example: Clear Ballot
include "clear_ballot_kansas_primary/clear_ballot_kansas_primary_config.json"
include "clear_ballot_kansas_primary/clear_ballot_kansas_primary.cvr.csv"

// CVR example: Dominion
include "dominion_kansas/dominion_kansas_config.json"
include "dominion_kansas/dominion_kansas/kansas_input_data/*.json"

// CVR example: ES&S
include "2015_portland_mayor/2015_portland_mayor_config.json"
include "2015_portland_mayor/2015_portland_mayor_cvr.xlsx"

// CVR example: Hart
include "hart_cedar_park_school_board/hart_cedar_park_school_board_config.json"
include "_shared/hart_cvr_archive/*.xml"

// CSV example: Hart
include "generic_csv_test/generic_csv_test_config.json"
include "generic_csv_test/generic_csv_test_cvr.json"

exclude "output"
exclude "**/*expected*"
}
Expand Down
Loading

0 comments on commit 2d47d57

Please sign in to comment.