Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Jun 2, 2022
0 parents commit 8512764
Show file tree
Hide file tree
Showing 15 changed files with 847 additions and 0 deletions.
125 changes: 125 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: CI
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
jobs:
generate-launchers:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: coursier/[email protected]
- uses: coursier/[email protected]
with:
jvm: temurin:17
- run: |
./mill -i "java-class-name.writeNativeImageScript" generate.sh "" && \
./generate.sh && \
./mill -i "java-class-name.copyToArtifacts" artifacts/
if: runner.os != 'Windows'
- run: |
@call ./mill.bat -i "java-class-name.writeNativeImageScript" generate.bat ""
@call generate.bat
@call ./mill.bat -i "java-class-name.copyToArtifacts" artifacts/
shell: cmd
if: runner.os == 'Windows'
- name: Test
run: ./mill -i java-class-name-tests.test
- uses: actions/[email protected]
with:
name: launcher-${{ matrix.os }}
path: artifacts/
if-no-files-found: error
retention-days: 1
- run: ./mill -i ci.upload artifacts/
if: github.event_name == 'push'
env:
UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

generate-static-launcher:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: coursier/[email protected]
- uses: coursier/[email protected]
with:
jvm: temurin:17
- run: |
./mill -i "java-class-name.static.writeNativeImageScript" generate.sh "" && \
./generate.sh && \
./mill -i "java-class-name.static.copyToArtifacts" artifacts/
- uses: actions/[email protected]
with:
name: launcher-linux-static
path: artifacts/
if-no-files-found: error
retention-days: 1
- name: Test
run: ./mill -i java-class-name-tests.static.test
- run: ./mill -i ci.upload artifacts/
if: github.event_name == 'push'
env:
UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

generate-mostly-static-launcher:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: coursier/[email protected]
- uses: coursier/[email protected]
with:
jvm: temurin:17
- run: |
./mill -i "java-class-name.mostly-static.writeNativeImageScript" generate.sh "" && \
./generate.sh && \
./mill -i "java-class-name.mostly-static.copyToArtifacts" artifacts/
- uses: actions/[email protected]
with:
name: launcher-linux-mostly-static
path: artifacts/
if-no-files-found: error
retention-days: 1
- name: Test
run: ./mill -i java-class-name-tests.mostly-static.test
- run: ./mill -i ci.upload artifacts/
if: github.event_name == 'push'
env:
UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
needs: generate-launchers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: coursier/[email protected]
- uses: coursier/[email protected]
with:
jvm: temurin:17
- run: .github/scripts/gpg-setup.sh
env:
PGP_SECRET: ${{ secrets.PUBLISH_SECRET_KEY }}
- name: Publish
run: ./mill -i ci.publishSonatype __.publishArtifacts
env:
PGP_PASSWORD: ${{ secrets.PUBLISH_SECRET_KEY_PASSWORD }}
SONATYPE_PASSWORD: ${{ secrets.PUBLISH_USER }}
SONATYPE_USERNAME: ${{ secrets.PUBLISH_PASSWORD }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out/
1 change: 1 addition & 0 deletions .mill-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.10.4
5 changes: 5 additions & 0 deletions Foo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package a.b;

public class Foo {

}
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# java-class-name

A small library and application to extract class names from Java sources.

Can be used as a library and via a binary (generated with GraalVM native image).

Mainly meant to be used by [Scala CLI](https://github.com/VirtusLab/scala-cli)
Loading

0 comments on commit 8512764

Please sign in to comment.