Skip to content

Commit

Permalink
Dev (#31)
Browse files Browse the repository at this point in the history
- Shorted boot time of the project

- Started on Battleship

- In the process to redesigning the Translated modules and Hexamaze

- Removed ControlsFX dependency

- Added Pitest plugin

- Adjusted tests to run in parallel
  • Loading branch information
Ultraviolet-Ninja authored Dec 14, 2021
1 parent f1c450c commit 6378afb
Show file tree
Hide file tree
Showing 209 changed files with 7,268 additions and 4,080 deletions.
Empty file removed .cache/dependencies.lockfile
Empty file.
50 changes: 34 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
version: 2
jobs:
build:
jacoco:
docker:
# specify the version you desire here
- image: cimg/openjdk:15.0.2
Expand All @@ -13,6 +13,8 @@ jobs:
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4
parallelism: 3
resource_class: large

working_directory: ~/repo

Expand All @@ -25,24 +27,40 @@ jobs:
- checkout
- run: chmod +x gradlew

# Download and cache dependencies
- restore_cache:
keys:
# when lock file changes, use increasingly general patterns to restore cache
- gradle-repo-v1-{{ .Branch }}-{{ checksum ".cache/dependencies.lockfile" }}
- gradle-repo-v1-{{ .Branch }}-
- gradle-repo-v1-

- run: ./gradlew dependencies

- save_cache:
paths:
- ~/.cache
key: gradle-repo-v1-{{ .Branch }}-{{ checksum ".cache/dependencies.lockfile" }}

# run tests!
- run: ./gradlew test
- run: ./gradlew test -Pthread$CIRCLE_NODE_INDEX
- store_test_results:
path: ./build/test-results/test
- store_artifacts:
path: ./build/reports
path: ./build/reports
pitest:
docker:
- image: cimg/openjdk:15.0.2
parallelism: 6
resource_class: large

working_directory: ~/repo

environment:
JVM_OPTS: -Xmx3200m
TERM: dumb

steps:
- checkout
- run: chmod +x gradlew
- run: ./gradlew dependencies

- run: ./gradlew pitest -Pthread$CIRCLE_NODE_INDEX
- store_test_results:
path: ./build/test-results/test
- store_artifacts:
path: ./build/reports

workflows:
version: 2
workflow:
jobs:
- jacoco
- pitest
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build
- name: Assemble with Gradle
run: ./gradlew assemble

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ hs_err_pid*
/build/
/.gradle/
Dockafile - Copy
/.project
/.settings/org.eclipse.buildship.core.prefs
4 changes: 2 additions & 2 deletions Progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
20/100 + Colored Switches

### Incomplete Modules
- Battleship
- Translated Vanilla Modules (9/15 Supported languages)
- Simon States
- Shape Shift

3/100
4/100

### Untouched Modules
- 3D Maze
- Adjacent Letters
- Adventure Game
- Anagrams
- Battleship
- Binary LEDs
- BitMaps
- Broken Button
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![CircleCI](https://circleci.com/gh/Ultraviolet-Ninja/GradleCenturion/tree/main.svg?style=shield)](https://circleci.com/gh/Ultraviolet-Ninja/GradleCenturion/tree/main)
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/Ultraviolet-Ninja/GradleCenturion.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Ultraviolet-Ninja/GradleCenturion/context:java)
![Project Version](https://img.shields.io/badge/version-0.21.0-blueviolet)
![Project Version](https://img.shields.io/badge/version-0.21.1-blueviolet)

## Intro
This project is designed to solve all puzzles found on the Centurion Bomb from Keep Talking and Nobody Explodes, which is a combination of many community-made puzzles and some from the base game set in different languages.<br>
Expand All @@ -16,6 +16,7 @@ This is a huge project for one man to tackle, but I've learned a lot from the ch
### Plugins
- Jacoco
- JavaFX
- Pitest
- Palantir Docker
- Breadmoirai GitHub Release
### Dependencies
Expand Down Expand Up @@ -50,8 +51,8 @@ Widgets are important details about the bomb such that many modules depend on wh
not. The list of details includes Port Types, Number of Port Plates, Lit and Unlit Indicators, Number of Batteries,
Number of Battery Holders, Two-Factor Authentication, and the Serial Code.
![WidgetOne](markdown/Widget1.jpg)
One D Battery in one holder and a lit NSA indicator
**One D Battery** in **one holder** and a **lit NSA indicator**

![WidgetTwo](markdown/Widget2.jpg)
One port plate with a PS/2 port, another D battery in one holder and a serial code "PN4XC5".<br>
Overall, this edgework would be given as "1 PS2 port in 1 plate, a lit NSA, 2 in 2 (2 batteries in 2 holders), and serial is Papa November 4 X-ray Charlie 5" (Using the Nato Phonetic Alphabet)
**One port plate** with a **PS/2 port**, another **D battery in one holder** and a serial code **"PN4XC5"**.<br>
Overall, this edgework would be given as "1 PS2 port in 1 plate, a lit November SA, 2 in 2 (2 batteries in 2 holders), and serial is Papa November 4 X-ray Charlie 5" (Using the Nato Phonetic Alphabet)
75 changes: 69 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ plugins {
id 'jacoco'
id 'application'
id 'com.palantir.docker' version '0.28.0'
id 'info.solidsoft.pitest' version '1.7.0'
id 'org.openjfx.javafxplugin' version '0.0.10'
id 'com.github.breadmoirai.github-release' version '2.2.12'
}

group 'jasmine.jragon'
version '0.21.0'
version '0.21.1'

mainClassName = 'bomb.Main'

sourceCompatibility = 15
targetCompatibility = 15

compileJava {
options.encoding("UTF-8")
}
Expand All @@ -32,12 +30,13 @@ repositories {
}

dependencies {
// compile 'org.jetbrains:annotations:22.0.0'

implementation 'com.opencsv:opencsv:5.5.2'
implementation 'com.jfoenix:jfoenix:9.0.4'
implementation 'org.javatuples:javatuples:1.2'
//implementation 'io.github.fvarrui:javpackager:1.5.1'
implementation 'eu.hansolo:Medusa:11.7'
implementation 'org.fxmisc.richtext:richtextfx:0.10.6'
implementation 'org.jgrapht:jgrapht-ext:1.5.1'
implementation('io.github.palexdev:materialfx:11.12.0') {
transitive(true)
Expand All @@ -47,13 +46,77 @@ dependencies {
testImplementation 'org.testng:testng:7.4.0'
}

def firstInstance = project.hasProperty("thread0")
def secondInstance = project.hasProperty("thread1")
def thirdInstance = project.hasProperty("thread2")
def fourthInstance = project.hasProperty("thread3")
def fifthInstance = project.hasProperty("thread4")
def sixthInstance = project.hasProperty("thread5")

def includedDirectories = [
'bomb/tools/data/**', 'bomb/tools/*', 'bomb/tools/logic/*'
]

test {
useTestNG()
useTestNG() {
if(firstInstance) {
suites "src/test/resources/suites/suiteOne.xml"
includedDirectories.addAll([
'bomb/modules/ab/**', 'bomb/modules/c/**',
'bomb/modules/dh/**', 'bomb/modules/il/**',
])
} else if (secondInstance) {
suites "src/test/resources/suites/suiteTwo.xml"
includedDirectories.addAll([
'bomb/modules/m/**', 'bomb/modules/np/**',
'bomb/modules/r/**', 'bomb/modules/s/**'
])
} else if (thirdInstance) {
suites "src/test/resources/suites/suiteThree.xml"
includedDirectories.addAll([
'bomb', 'bomb/tools/filter/*',
'bomb/modules/t/**', 'bomb/modules/wz/**'
])
}
}
finalizedBy(jacocoTestReport)
}

jacocoTestReport {
reports.xml.enabled(true)

if (includedDirectories.size() != 3) {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, include: includedDirectories, exclude: ['**/*Controller.*'])
}))
}
}
}

static List<String> getTargetClasses(boolean firstInstance, boolean secondInstance,
boolean thirdInstance, boolean fourthInstance,
boolean fifthInstance, boolean sixthInstance) {
if (firstInstance)
return ['bomb.modules.ab.**']
else if (secondInstance)
return ['bomb.modules.c.**']
else if (thirdInstance)
return ['bomb.modules.dh.**', 'bomb.modules.il.**']
else if (fourthInstance)
return ['bomb.modules.m.**', 'bomb.modules.np.**']
else if (fifthInstance)
return ['bomb.modules.r.**', 'bomb.modules.s.**']
else if (sixthInstance)
return ['bomb.modules.t.**', 'bomb.tools.filter.*']
return ['bomb.*']
}

pitest {
targetClasses = getTargetClasses(firstInstance, secondInstance, thirdInstance,
fourthInstance, fifthInstance, sixthInstance)
outputFormats = ['HTML']
testPlugin = 'testng'
}

javafx {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
.@{fa-css-prefix}-pied-piper-alt:before { content: @fa-var-pied-piper-alt; }
.@{fa-css-prefix}-drupal:before { content: @fa-var-drupal; }
.@{fa-css-prefix}-joomla:before { content: @fa-var-joomla; }
.@{fa-css-prefix}-language:before { content: @fa-var-language; }
.@{fa-css-prefix}-languageColumn:before { content: @fa-var-languageColumn; }
.@{fa-css-prefix}-fax:before { content: @fa-var-fax; }
.@{fa-css-prefix}-building:before { content: @fa-var-building; }
.@{fa-css-prefix}-child:before { content: @fa-var-child; }
Expand Down Expand Up @@ -710,14 +710,14 @@
.@{fa-css-prefix}-braille:before { content: @fa-var-braille; }
.@{fa-css-prefix}-assistive-listening-systems:before { content: @fa-var-assistive-listening-systems; }
.@{fa-css-prefix}-asl-interpreting:before,
.@{fa-css-prefix}-american-sign-language-interpreting:before { content: @fa-var-american-sign-language-interpreting; }
.@{fa-css-prefix}-american-sign-languageColumn-interpreting:before { content: @fa-var-american-sign-languageColumn-interpreting; }
.@{fa-css-prefix}-deafness:before,
.@{fa-css-prefix}-hard-of-hearing:before,
.@{fa-css-prefix}-deaf:before { content: @fa-var-deaf; }
.@{fa-css-prefix}-glide:before { content: @fa-var-glide; }
.@{fa-css-prefix}-glide-g:before { content: @fa-var-glide-g; }
.@{fa-css-prefix}-signing:before,
.@{fa-css-prefix}-sign-language:before { content: @fa-var-sign-language; }
.@{fa-css-prefix}-sign-languageColumn:before { content: @fa-var-sign-languageColumn; }
.@{fa-css-prefix}-low-vision:before { content: @fa-var-low-vision; }
.@{fa-css-prefix}-viadeo:before { content: @fa-var-viadeo; }
.@{fa-css-prefix}-viadeo-square:before { content: @fa-var-viadeo-square; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@fa-var-align-right: "\f038";
@fa-var-amazon: "\f270";
@fa-var-ambulance: "\f0f9";
@fa-var-american-sign-language-interpreting: "\f2a3";
@fa-var-american-sign-languageColumn-interpreting: "\f2a3";
@fa-var-anchor: "\f13d";
@fa-var-android: "\f17b";
@fa-var-angellist: "\f209";
Expand Down Expand Up @@ -406,7 +406,7 @@
@fa-var-key: "\f084";
@fa-var-keyboard-o: "\f11c";
@fa-var-krw: "\f159";
@fa-var-language: "\f1ab";
@fa-var-languageColumn: "\f1ab";
@fa-var-laptop: "\f109";
@fa-var-lastfm: "\f202";
@fa-var-lastfm-square: "\f203";
Expand Down Expand Up @@ -595,7 +595,7 @@
@fa-var-shopping-cart: "\f07a";
@fa-var-shower: "\f2cc";
@fa-var-sign-in: "\f090";
@fa-var-sign-language: "\f2a7";
@fa-var-sign-languageColumn: "\f2a7";
@fa-var-sign-out: "\f08b";
@fa-var-signal: "\f012";
@fa-var-signing: "\f2a7";
Expand Down
6 changes: 3 additions & 3 deletions documentation/Cup O' Java.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@
"lgndColoredKeys",
"ColoredSquaresModule",
"colorfulDials",
"ColoredSwitchesModule",
"ColorfulInsanity",
"ColorfulMadness",
"colourcode",
Expand Down Expand Up @@ -296,7 +295,6 @@
"hereditaryBaseNotationModule",
"harmonySequence",
"EternitySDec",
"HexamazeModule",
"hexOS",
"lgndHiddenColors",
"hideAndSeek",
Expand Down Expand Up @@ -590,7 +588,6 @@
"simonSamples",
"ksmSimonLitSays",
"simonScrambles",
"SimonScreamsModule",
"simonSelectsModule",
"SimonSendsModule",
"SimonShrieksModule",
Expand Down Expand Up @@ -799,12 +796,15 @@
"BitOps",
"BlindAlleyModule",
"booleanVennModule",
"ColoredSwitchesModule",
"ChordQualities",
"DayTimeWidget",
"Emoji Math",
"HexamazeModule",
"Laundry",
"KeypadV2",
"neutralization",
"SimonScreamsModule",
"TheBulbModule",
"TwoBits"
],
Expand Down
4 changes: 2 additions & 2 deletions documentation/journals/Old Code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@ package bomb.modules.ab.boolean_venn;

import bomb.Widget;

import static bomb.tools.filter.Mechanics.LOGIC_SYMBOL_REGEX;
import static bomb.tools.filter.Mechanics.ultimateFilter;
import static bomb.tools.filter.StreamFilter.LOGIC_SYMBOL_REGEX;
import static bomb.tools.filter.StreamFilter.ultimateFilter;

/**
* This class deals with the Boolean Venn Diagram module.
Expand Down
Loading

0 comments on commit 6378afb

Please sign in to comment.