Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
72f36b2fe1 | ||
![]() |
46f3cb1386 | ||
![]() |
79a1f939e6 | ||
![]() |
2592ca511f | ||
![]() |
3e5e2e01ec | ||
![]() |
21125ed895 | ||
![]() |
dddfb6f622 |
34
.github/workflows/maven-publish.yml
vendored
Normal file
34
.github/workflows/maven-publish.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
|
||||
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
|
||||
|
||||
name: Maven Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
|
||||
- name: Publish to GitHub Packages Apache Maven
|
||||
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
1
README.md
Normal file
1
README.md
Normal file
@@ -0,0 +1 @@
|
||||
[](https://github.com/shrapnelnet/libremines/actions/workflows/maven-publish.yml)
|
20
pom.xml
20
pom.xml
@@ -35,6 +35,24 @@
|
||||
<mainClass>libremines/com.shr4pnel.minesweeper.Main</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.13.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.gluonhq</groupId>
|
||||
<artifactId>gluonfx-maven-plugin</artifactId>
|
||||
<version>1.0.22</version>
|
||||
<configuration>
|
||||
<mainClass>com.shr4pnel.minesweeper.Main</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-wrapper-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
</project>
|
||||
|
@@ -236,12 +236,17 @@ public class Controller {
|
||||
|
||||
private void showAllBombs(int clickedColumn, int clickedRow) {
|
||||
for (Node node : grid.getChildren()) {
|
||||
Button b = (Button) node;
|
||||
String buttonURL = ((ImageView) b.getGraphic()).getImage().getUrl();
|
||||
int column = GridPane.getColumnIndex(node);
|
||||
int row = GridPane.getRowIndex(node);
|
||||
if (!(column == clickedColumn && row == clickedRow) &&
|
||||
wrapper.atColumn(column).atRow(row).isBomb()) {
|
||||
setImage((Button) node, "img/bomb_revealed.png");
|
||||
}
|
||||
if (buttonURL.contains("flagged.png") && !wrapper.atColumn(column).atRow(row).isBomb()) {
|
||||
setImage(b, "img/bomb_wrong.png");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,7 +274,6 @@ public class Controller {
|
||||
|
||||
private void setAdjacentCount(Node tileClicked, int adjacentBombs) {
|
||||
Button button = (Button) tileClicked;
|
||||
URL imageURL = getClass().getResource("img/num_" + adjacentBombs + ".png");
|
||||
button.setGraphic(new ImageView(new Image(String.valueOf(imageURL), 16, 16, true, false)));
|
||||
setImage(button, "img/num_" + adjacentBombs + ".png");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user