Skip to content

Commit 56ea8a0

Browse files
authored
Initial Commit
2 parents 1534a13 + e2bb5f8 commit 56ea8a0

36 files changed

+2389
-1
lines changed

.editorconfig

+1,129
Large diffs are not rendered by default.

.github/workflows/ci.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags-ignore:
7+
- heo-*
8+
pull_request:
9+
jobs:
10+
ci:
11+
permissions:
12+
pull-requests: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up JDK
17+
uses: graalvm/setup-graalvm@v1
18+
with:
19+
java-version: '21' # See 'Options' section below for all supported versions
20+
distribution: 'graalvm' # See 'Options' section below for all available distributions
21+
- name: Check Gradle Version
22+
run: |
23+
chmod +x gradlew
24+
./gradlew --version
25+
- name: Test task with Gradle Wrapper
26+
run: |
27+
./gradlew --parallel --max-workers=4 build
28+
- name: Create report file
29+
if: success()
30+
run: |
31+
sudo apt install -y graphviz
32+
JAR_FILE=$(ls -al ./build/libs/ | tail -1 | awk '{print $9}')
33+
java -jar ./build/libs/$JAR_FILE -d $(pwd) -p com.heowc.heo.core -o ${{ github.event.pull_request.number }}.png
34+
- name: Create self test report
35+
if: success() && github.event.pull_request.number != ''
36+
uses: actions/upload-artifact@v4
37+
with:
38+
path: ${{ github.event.pull_request.number }}.png
39+
name: interg-reports
40+
retention-days: 7
41+
42+
- name: If failure then upload test reports
43+
if: failure()
44+
uses: actions/upload-artifact@v4
45+
with:
46+
path: '*/build/reports/tests'
47+
name: test-reports
48+
retention-days: 7

.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
HELP.md
2+
.gradle
3+
build/
4+
!gradle/wrapper/gradle-wrapper.jar
5+
!**/src/main/**/build/
6+
!**/src/test/**/build/
7+
8+
### STS ###
9+
.apt_generated
10+
.classpath
11+
.factorypath
12+
.project
13+
.settings
14+
.springBeans
15+
.sts4-cache
16+
bin/
17+
!**/src/main/**/bin/
18+
!**/src/test/**/bin/
19+
20+
### IntelliJ IDEA ###
21+
.idea
22+
*.iws
23+
*.iml
24+
*.ipr
25+
out/
26+
!**/src/main/**/out/
27+
!**/src/test/**/out/
28+
29+
### NetBeans ###
30+
/nbproject/private/
31+
/nbbuild/
32+
/dist/
33+
/nbdist/
34+
/.nb-gradle/
35+
36+
### VS Code ###
37+
.vscode/

.sdkmanrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Use sdkman to run "sdk env" to initialize with correct JDK version
2+
# Enable auto-env through the sdkman_auto_env config
3+
# See https://sdkman.io/usage#config
4+
# A summary is to add the following to ~/.sdkman/etc/config
5+
# sdkman_auto_env=true
6+
java=21.0.2-graalce

README.md

+44-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,44 @@
1-
# heo
1+
# heo
2+
3+
Tools to analyze package-level structure and visualize it
4+
5+
# install
6+
7+
Download the latest jar file from the [release](https://github.com/heowc/heo/releases)
8+
9+
This tool relies on [graphviz](https://graphviz.org/). Please install graphviz first.
10+
11+
# usage
12+
13+
- `d`: Enter the directory path.
14+
- `p`: Enter the package path.
15+
- `o`: Enter the destination file path.
16+
17+
```bash
18+
java -jar heo-0.0.1.jar -d /Users/heowc/Projects/heo -p com.heowc.heo
19+
```
20+
21+
```text
22+
$ java -jar heo-0.0.1.jar -d /Users/heowc/Projects/heo -p com.heowc.heo
23+
__ __ _______ _______
24+
| | | || || |
25+
| |_| || ___|| _ |
26+
| || |___ | | | |
27+
| || ___|| |_| |
28+
| _ || |___ | |
29+
|__| |__||_______||_______|
30+
31+
2024-05-01T17:23:52.031+09:00 INFO 72099 --- [ main] c.h.h.c.l.a.ModuleLoaderService : Loading com.heowc.heo from ./
32+
2024-05-01T17:23:52.044+09:00 INFO 72099 --- [ main] c.h.h.c.a.a.DependencyAnalysisService : Analysing project dependencies for modules. size=0
33+
2024-05-01T17:23:52.445+09:00 INFO 72099 --- [ main] c.h.h.c.v.ReportVisualizationService : Report file created (file:///Users/heowc/Projects/heo/result-1714551832030.png)
34+
```
35+
36+
## Result
37+
38+
![image sample](./docs/sample.png)
39+
40+
# What's next
41+
42+
- Support native
43+
- See https://github.com/oracle/graal/issues/8273
44+
- Support plugin (gradle, maven etc)

build.gradle

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
plugins {
2+
id 'java'
3+
id 'org.springframework.boot' version '3.2.4'
4+
id 'io.spring.dependency-management' version '1.1.4'
5+
id 'org.graalvm.buildtools.native' version '0.9.16'
6+
id 'maven-publish'
7+
}
8+
9+
group = 'com.heowc'
10+
version = '0.0.1'
11+
12+
java {
13+
sourceCompatibility = '17'
14+
}
15+
16+
repositories {
17+
mavenCentral()
18+
}
19+
20+
ext {
21+
set('springShellVersion', "3.2.3")
22+
}
23+
24+
dependencies {
25+
implementation 'org.springframework.shell:spring-shell-starter'
26+
implementation 'guru.nidi:graphviz-java:0.18.1'
27+
implementation 'guru.nidi:graphviz-java-min-deps:0.18.1'
28+
29+
implementation 'org.jgrapht:jgrapht-core:1.5.2'
30+
implementation 'org.jgrapht:jgrapht-io:1.5.2'
31+
32+
implementation 'com.github.javaparser:javaparser-core:3.25.10'
33+
34+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
35+
testImplementation 'org.springframework.shell:spring-shell-test'
36+
testImplementation 'org.springframework.shell:spring-shell-test-autoconfigure'
37+
}
38+
39+
dependencyManagement {
40+
imports {
41+
mavenBom "org.springframework.shell:spring-shell-dependencies:${springShellVersion}"
42+
}
43+
}
44+
45+
graalvmNative {
46+
metadataRepository {
47+
enabled = true
48+
}
49+
binaries {
50+
main {
51+
buildArgs.add('--verbose')
52+
buildArgs.add('-H:IncludeResources=.*js$')
53+
buildArgs.add("-H:ReflectionConfigurationFiles=${projectDir}/src/main/resources/META-INF/native-image/reflect-config.json")
54+
buildArgs.add("-H:ResourceConfigurationFiles=${projectDir}/src/main/resources/META-INF/native-image/resource-config.json")
55+
}
56+
}
57+
}
58+
59+
tasks.named('test') {
60+
useJUnitPlatform()
61+
}
62+
63+
publishing {
64+
repositories {
65+
maven {
66+
name = "GitHubPackages"
67+
url = uri("https://maven.pkg.github.com/heowc/heo")
68+
credentials {
69+
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
70+
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
71+
}
72+
}
73+
}
74+
publications {
75+
gpr(MavenPublication) {
76+
from(components.java)
77+
}
78+
}
79+
}

gradle/wrapper/gradle-wrapper.jar

42.4 KB
Binary file not shown.
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)