Skip to content

Commit 87c2e4e

Browse files
Initial commit
0 parents  commit 87c2e4e

File tree

16 files changed

+858
-0
lines changed

16 files changed

+858
-0
lines changed

.github/scripts/gpg-setup.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
# from https://github.com/coursier/apps/blob/f1d2bf568bf466a98569a85c3f23c5f3a8eb5360/.github/scripts/gpg-setup.sh
5+
6+
echo "$PGP_SECRET" | base64 --decode | gpg --import --no-tty --batch --yes
7+
8+
echo "allow-loopback-pinentry" >>~/.gnupg/gpg-agent.conf
9+
echo "pinentry-mode loopback" >>~/.gnupg/gpg.conf
10+
11+
gpg-connect-agent reloadagent /bye

.github/workflows/ci.yml

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags:
7+
- "v*"
8+
pull_request:
9+
jobs:
10+
generate-launchers:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
submodules: true
21+
- uses: coursier/[email protected]
22+
- uses: coursier/[email protected]
23+
with:
24+
jvm: temurin:17
25+
- run: |
26+
./mill -i "java-class-name.writeNativeImageScript" generate.sh "" && \
27+
./generate.sh && \
28+
./mill -i "java-class-name.copyToArtifacts" artifacts/
29+
if: runner.os != 'Windows'
30+
- run: |
31+
@call ./mill.bat -i "java-class-name.writeNativeImageScript" generate.bat ""
32+
@call generate.bat
33+
@call ./mill.bat -i "java-class-name.copyToArtifacts" artifacts/
34+
shell: cmd
35+
if: runner.os == 'Windows'
36+
- name: Test
37+
run: ./mill -i java-class-name-tests.test
38+
- uses: actions/[email protected]
39+
with:
40+
name: launcher-${{ matrix.os }}
41+
path: artifacts/
42+
if-no-files-found: error
43+
retention-days: 1
44+
- run: ./mill -i ci.upload artifacts/
45+
if: github.event_name == 'push'
46+
env:
47+
UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
49+
generate-static-launcher:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v2
53+
with:
54+
fetch-depth: 0
55+
submodules: true
56+
- uses: coursier/[email protected]
57+
- uses: coursier/[email protected]
58+
with:
59+
jvm: temurin:17
60+
- run: |
61+
./mill -i "java-class-name.static.writeNativeImageScript" generate.sh "" && \
62+
./generate.sh && \
63+
./mill -i "java-class-name.static.copyToArtifacts" artifacts/
64+
- uses: actions/[email protected]
65+
with:
66+
name: launcher-linux-static
67+
path: artifacts/
68+
if-no-files-found: error
69+
retention-days: 1
70+
- name: Test
71+
run: ./mill -i java-class-name-tests.static.test
72+
- run: ./mill -i ci.upload artifacts/
73+
if: github.event_name == 'push'
74+
env:
75+
UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
77+
generate-mostly-static-launcher:
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/checkout@v2
81+
with:
82+
fetch-depth: 0
83+
submodules: true
84+
- uses: coursier/[email protected]
85+
- uses: coursier/[email protected]
86+
with:
87+
jvm: temurin:17
88+
- run: |
89+
./mill -i "java-class-name.mostly-static.writeNativeImageScript" generate.sh "" && \
90+
./generate.sh && \
91+
./mill -i "java-class-name.mostly-static.copyToArtifacts" artifacts/
92+
- uses: actions/[email protected]
93+
with:
94+
name: launcher-linux-mostly-static
95+
path: artifacts/
96+
if-no-files-found: error
97+
retention-days: 1
98+
- name: Test
99+
run: ./mill -i java-class-name-tests.mostly-static.test
100+
- run: ./mill -i ci.upload artifacts/
101+
if: github.event_name == 'push'
102+
env:
103+
UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
105+
publish:
106+
needs: generate-launchers
107+
runs-on: ubuntu-latest
108+
steps:
109+
- uses: actions/checkout@v2
110+
with:
111+
fetch-depth: 0
112+
submodules: true
113+
- uses: coursier/[email protected]
114+
- uses: coursier/[email protected]
115+
with:
116+
jvm: temurin:17
117+
- run: .github/scripts/gpg-setup.sh
118+
env:
119+
PGP_SECRET: ${{ secrets.PUBLISH_SECRET_KEY }}
120+
- name: Publish
121+
run: ./mill -i ci.publishSonatype __.publishArtifacts
122+
env:
123+
SONATYPE_USERNAME: ${{ secrets.PUBLISH_USER }}
124+
SONATYPE_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}
125+
PGP_PASSWORD: ${{ secrets.PUBLISH_SECRET_KEY_PASSWORD }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
out/

.mill-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.10.4

Foo.java

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package a.b;
2+
3+
public class Foo {
4+
5+
}

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# java-class-name
2+
3+
A small library and application to extract class names from Java sources.
4+
5+
Can be used as a library and via a binary (generated with GraalVM native image).
6+
7+
Mainly meant to be used by [Scala CLI](https://github.com/VirtusLab/scala-cli)

0 commit comments

Comments
 (0)