Skip to content

Commit

Permalink
Dev (#37)
Browse files Browse the repository at this point in the history
- Fixed serial code specifications

- Finally added the dependency for the JetBrains annotations

- Finished solutions for Ice Cream, WordSearch, Morsematics, SquareButton, and Murder

- Removed Medusa dependency

- Upped to Java 17
  • Loading branch information
Ultraviolet-Ninja authored Dec 28, 2021
1 parent 6378afb commit 1b1a6c5
Show file tree
Hide file tree
Showing 114 changed files with 2,303 additions and 725 deletions.
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
jacoco:
docker:
# specify the version you desire here
- image: cimg/openjdk:15.0.2
- image: cimg/openjdk:17.0.1

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
path: ./build/reports
pitest:
docker:
- image: cimg/openjdk:15.0.2
- image: cimg/openjdk:17.0.1
parallelism: 6
resource_class: large

Expand All @@ -53,8 +53,6 @@ jobs:
- run: ./gradlew dependencies

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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up JDK 15
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 15
java-version: 17
distribution: 'adopt'
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .lgtm.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extraction:
java:
index:
java_version: 15
java_version: 16
37 changes: 37 additions & 0 deletions Learned.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# What I've learned
## JavaFX Custom Components
- Understanding how to create CC's with this [video](https://www.youtube.com/watch?v=1yuaJQJ1FXg) as a guide.
- Experimenting with CC's to figure out how to correctly turn them into jar files that are compatible with SceneBuilder.
- Utilizing CSS to style components and make them look like the puzzles in the game.
## Project Tech/Design Choices
When my friend was working on the project, he helped me decide to move to a RadioButton design for switching between puzzles. This helped me get away from my previous design of nested TabPanes in a TabPane, which probably isn't the most visually appealing.

Another thing we talked about while he was on the project was moving back to Java 8 since it was easier to work with JavaFX. This decision was later reversed after some time experimenting in Gradle. Since I have dependencies that needed to be taken into account, Java 15 was the one I landed on.
## Gradle/Continuous Integration
- Using the build.gradle file to organize dependencies and plugins, facilitate testing, set up distributions in zip and tar files, and releases for GitHub.
- Making custom tasks and using parameters for CI pipelines to test certain parts of the code.
- Automating tests with CircleCI using this [video](https://www.youtube.com/watch?v=9PgZCJNzY9M) as a guide.
- Coming across [LGTM](https://lgtm.com/) and taking advantage of its code quality checking for flaws in my Java code.
## Graphs and their Algorithms
- Creating graphs by looking up the concept or using the JGraphT library.
- Making use of Dijkstra's Shortest Path and A* to solve different problems.
## From my Internship
- Using a backlog to organize tasks that are done, in progress, or haven't been looked at.
- Creating results that get deployed to GitHub and can be downloaded by anyone.
- Using a less technical version of design documents. I used them to outline how I will solve puzzles and what the front end will look like.
## From my Classes
### School
#### Tools & Practices
- Understanding how to use Git and GitHub to host my project.
- Having an introduction to Gradle from one of my teammates trying to bring it into the project. (Wasn't successful, but still)
#### Verification
- Understanding the perks of TestNG vs. my previous experience with J-Unit.
- Discovering Pitest, Exploratory Testing, Mockito, and Jacoco as different ways to test code and thinking about which concepts I should implement into the project.
#### Design Patterns
- Using Factories, Facade, and Observers to facilitate repeating code and updating related modules.
- Being introduced to code coupling and cohesion, which was later applied when I had a CodeMR free trial.
### Udemy
- Understanding how to write Groovy code. [Link](https://www.udemy.com/course/gradle-for-java-developers/)
- Using CompletableFuture to split up unrelated tasks. [Link](https://www.udemy.com/course/parallel-and-asynchronous-programming-in-modern-java/)
- Utilizing functional interfaces and the Streams API wherever necessary. [Link](https://www.udemy.com/course/functional-programming-and-reactive-programming-in-java/)
- Learning about graph algorithms and heuristics. [Link](https://www.udemy.com/course/artificial-intelligence-games-in-java/learn/lecture/5958944?start=0#overview)
15 changes: 8 additions & 7 deletions Progress.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Module Progress
### Finished Modules
- Alphabet
- Astrology
Expand Down Expand Up @@ -25,11 +26,16 @@

### Incomplete Modules
- Battleship
- Ice Cream
- Morsematics
- Murder
- Translated Vanilla Modules (9/15 Supported languages)
- Simon States
- Shape Shift
- Square Button
- Word Search

4/100
9/100

### Untouched Modules
- 3D Maze
Expand Down Expand Up @@ -60,7 +66,6 @@
- Follow the Leader
- Foreign Exchange Rates
- Friendship
- Ice Cream
- LED Encryption
- Letter Keys
- Light Cycle
Expand All @@ -70,9 +75,7 @@
- MineSweeper
- Modules Against Humanity
- Monsplode Fight
- Morsematics
- Mouse in the Maze
- Murder
- Mystic Square
- Number Pad
- Perspective Pegs
Expand All @@ -92,7 +95,6 @@
- Semaphore
- Silly Slots
- Skewed Slots
- Square Button
- Symbolic Password
- Text Field
- The Clock
Expand All @@ -104,8 +106,7 @@
- Web Design
- Wire Placement
- Word Scramble
- Word Search
- Yahtzee
- Zoo

77/100
72/100
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

[![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.1-blueviolet)
![Project Version](https://img.shields.io/badge/version-0.21.2-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>

This is a huge project for one man to tackle, but I've learned a lot from the challenges I've faced.
This is a huge project for one man to tackle, but I've [learned a lot](Learned.md) from the challenges I've faced.

## Technologies
- Java 15
- Gradle 6.8.1
- Java 17
- Gradle 7.3.3
### Plugins
- Jacoco
- JavaFX
Expand All @@ -23,16 +23,14 @@ This is a huge project for one man to tackle, but I've learned a lot from the ch
- MaterialFX ver 11.12.0
- JFoenix ver 9.0.4
- JavaTuple ver 1.2
- Medusa ver. 11.7
- JGraphT ver. 1.5.1
- OpenCSV ver. 5.5.2
### Other Technologies
- Circle CI
- LGTM Code Quality
- CodeMR Free Trial

## Status
In progress<br>
## Status - In progress
See the running list of modules [here](Progress.md)

## Inspiration
Expand Down
71 changes: 43 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@ plugins {
id 'java'
id 'jacoco'
id 'application'
id 'org.beryx.jlink' version '2.24.4'
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 'org.javamodularity.moduleplugin' version '1.8.10'
id 'com.github.breadmoirai.github-release' version '2.2.12'
}

group 'jasmine.jragon'
version '0.21.1'
version '0.21.2'

mainClassName = 'bomb.Main'
application {
mainClassName = project.hasProperty('testingArea') ?
'bomb.TestingArea' :
'bomb.Main'

mainModule.set('bomb')
}

compileJava {
options.encoding("UTF-8")
Expand All @@ -30,28 +38,28 @@ 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.jgrapht:jgrapht-ext:1.5.1'
implementation 'org.jetbrains:annotations:22.0.0'
//implementation 'io.github.fvarrui:javpackager:1.5.1'

implementation('com.jfoenix:jfoenix:9.0.4') {
exclude group: "org.javafx"
}
implementation('io.github.palexdev:materialfx:11.12.0') {
transitive(true)
exclude group: "org.javafx"
}

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 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/*'
Expand Down Expand Up @@ -108,7 +116,7 @@ static List<String> getTargetClasses(boolean firstInstance, boolean secondInstan
else if (fifthInstance)
return ['bomb.modules.r.**', 'bomb.modules.s.**']
else if (sixthInstance)
return ['bomb.modules.t.**', 'bomb.tools.filter.*']
return ['bomb.modules.t.**', 'bomb.modules.wz.**','bomb.tools.filter.*']
return ['bomb.*']
}

Expand All @@ -120,26 +128,33 @@ pitest {
}

javafx {
version = '15'
modules = ['javafx.controls', 'javafx.fxml', 'javafx.graphics']
version = '17'
modules = ['javafx.controls', 'javafx.fxml']
}

jar.manifest.attributes(['Main-Class': "${mainClassName}"])

task fatJar(type: Jar) {
manifest.from jar.manifest
from {
configurations.runtimeClasspath.collect {it.isDirectory() ? it : zipTree(it)}
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = "${project.name}"
}
}

artifacts {
archives fatJar
}
//task fatJar(type: Jar) {
// manifest.from jar.manifest
// from {
// configurations.runtimeClasspath.collect {it.isDirectory() ? it : zipTree(it)}
// } {
// exclude "META-INF/*.SF"
// exclude "META-INF/*.DSA"
// exclude "META-INF/*.RSA"
// }
//}
//
//artifacts {
// archives fatJar
//}

docker {
dependsOn(jar)
Expand Down
2 changes: 1 addition & 1 deletion documentation/journals/old_code/hexagon/OldMazeRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private static Coordinates getBackTrackingMove(String direction, HexGrid gatedGr

private static Coordinates calculateMove(String direction, HexGrid gatedGrid){
if ("14".contains(direction)) return upOrDown(direction);
int x = currentLocation.getX();
int x = currentLocation.x();
if (x == gatedGrid.sideLength() - 1)
return centerColumnNextMove(direction);
else if (x < gatedGrid.sideLength() - 1)
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 2 additions & 3 deletions src/main/java/bomb/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
import javafx.scene.image.Image;
import javafx.stage.Stage;

import java.util.Objects;

@SuppressWarnings("ConstantConditions")
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(Objects.requireNonNull(Main.class.getResource("manual.fxml")));
Parent root = FXMLLoader.load(Main.class.getResource("manual.fxml"));
primaryStage.setTitle("Centurion Bomb Manual");
primaryStage.setScene(new Scene(root));
primaryStage.getIcons().add(new Image(String.valueOf(Main.class.getResource("KTANE logo.png"))));
Expand Down
Loading

0 comments on commit 1b1a6c5

Please sign in to comment.