Skip to content

Commit e09b119

Browse files
authored
Merge pull request #57 from rabestro/feature/setup-mise-and-fix-build
Setup mise and fix build dependencies
2 parents 6cbc49f + f7bf78e commit e09b119

5 files changed

Lines changed: 52 additions & 29 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,16 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v6
14-
with:
15-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
1614
- name: Set up JDK 17
1715
uses: actions/setup-java@v5
1816
with:
1917
distribution: 'temurin'
2018
java-version: 17
21-
- name: Cache SonarCloud packages
22-
uses: actions/cache@v4
23-
with:
24-
path: ~/.sonar/cache
25-
key: ${{ runner.os }}-sonar
26-
restore-keys: ${{ runner.os }}-sonar
2719
- name: Cache Gradle packages
2820
uses: actions/cache@v4
2921
with:
3022
path: ~/.gradle/caches
3123
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
3224
restore-keys: ${{ runner.os }}-gradle
33-
- name: Build and analyze
34-
env:
35-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
36-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37-
run: ./gradlew build sonarqube --info
25+
- name: Build and Test
26+
run: ./gradlew build --info

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ out/
3535
.DS_Store
3636
/algorithm/gradle.properties
3737
/sample/gradle.properties
38+
39+
# Logs
40+
spring-shell.log

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rabestro_algorithms&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rabestro_algorithms)
2-
31
# Graph search algorithms
42

53
The project implements an interface for the weighted graph, as well as two algorithms for finding a path in the graph.
@@ -12,6 +10,43 @@ There are implementations and tests for two algorithms:
1210
The implementation is written in Java 17. [API documentation](https://algorithms.jc.id.lv/docs/api/) is available. You
1311
can also see the [specifications](https://algorithms.jc.id.lv/docs/spock-reports/) generated with the spock-reports.
1412

13+
## Development Setup with Mise
14+
15+
This project uses [mise](https://mise.jdx.dev/) to manage its toolchain (Java 17 and Gradle 7.5.1) and run development tasks.
16+
17+
To set up the development environment:
18+
19+
1. Install `mise` if you haven't already.
20+
2. Trust the project configuration:
21+
```shell
22+
mise trust
23+
```
24+
3. Install the required tools (Java and Gradle):
25+
```shell
26+
mise install
27+
```
28+
29+
### Available Tasks
30+
31+
You can run various tasks defined in `mise.toml`:
32+
33+
* **Build and Test**: Run the test suite and build the project:
34+
```shell
35+
mise run build
36+
```
37+
* **Run Java Demo**: Launch the Java application demo:
38+
```shell
39+
mise run demo-java
40+
```
41+
* **Run Groovy Demo**: Launch the Groovy script demo:
42+
```shell
43+
mise run demo-groovy
44+
```
45+
* **Run Graph Shell**: Launch the interactive console shell:
46+
```shell
47+
mise run demo-shell
48+
```
49+
1550
## Demo. Graph Shell
1651

1752
To demonstrate the work of search algorithms, I made a small console program '[Graph Shell](graph-shell/README.md)'. The program

algorithm/build.gradle

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ plugins {
33
id 'java-library'
44
id 'maven-publish'
55
id 'jacoco'
6-
id 'org.sonarqube' version '3.4.0.2513'
7-
}
8-
9-
sonarqube {
10-
properties {
11-
property "sonar.projectKey", "rabestro_algorithms"
12-
property "sonar.organization", "rabestro"
13-
property "sonar.host.url", "https://sonarcloud.io"
14-
}
156
}
167

178
group 'lv.id.jc'

graph-shell/README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,25 @@ To demonstrate the work of search algorithms, I made a small console program. Th
88

99
## Build & Run
1010

11-
To compile the program, use the command:
11+
You can build and run this program easily using **mise**:
1212

1313
```shell
14-
$ gradle assemble
14+
$ mise run demo-shell
1515
```
1616

17-
This command will create an executable jar, so in Linux or macOS you may run the application by
17+
Alternatively, you can compile and run using Gradle manually (using the toolchain managed by `mise` or system tools):
1818

19+
To compile:
1920
```shell
20-
$ ./build/libs/graph-shell-1.0-SNAPSHOT.jar
21+
$ gradle assemble
2122
```
2223

23-
On the Windows machine you should run the application using java:
24+
This command will create an executable JAR. On Linux or macOS you can run it via:
25+
```shell
26+
$ ./build/libs/graph-shell-1.0-SNAPSHOT.jar
27+
```
2428

29+
On a Windows machine you should run the application using Java:
2530
```shell
2631
$ java -jar ./build/libs/graph-shell-1.0-SNAPSHOT.jar
2732
```

0 commit comments

Comments
 (0)