Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattribute
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
28 changes: 28 additions & 0 deletions .github/workflows/java-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Java CI

on:
push:
branches: [ '*', '*/*' ]

jobs:
build:
name: Build for GraalVM (OpenJDK ${{ matrix.javaver }}) on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
javaver: [21, 22, 23, 24]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: GitHub Action for GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: ${{ matrix.javaver }}
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Build and test
run: mvn package
- name: Native test
run: mvn -Pnative test
28 changes: 28 additions & 0 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Javadoc

on:
release:
types: [ created ]


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: GitHub Action for GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: 23
distribution: 'graalvm'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile
run: mvn compile
- name: Javadoc
run: mvn javadoc:javadoc
- name: Publish Documentation on GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/site/apidocs

45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish package to the Maven Central Repository and GitHub Packages

on:
release:
types: [ created ]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 23
- name: Build with Maven
run: mvn -ntp -B package
- name: Publish to GitHub Packages
run: mvn -ntp -B -DskipTests -Prelease-gh deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to the Maven Central Repository
run: |
mvn -ntp -B -DskipTests -Prelease-ossrh deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}

14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Java
*.class
*.jar
*.war
*.ear
hs_err_pid*

# Directories
target/
test-results-native/

# OS generating files
.DS_Store
Thumbs.db
19 changes: 19 additions & 0 deletions .gitmessage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@


########50 characters############################
## Prefix examples:
#
# new: a new feature
# fix: a bug fix
# update: a slight change
# merge: merge pull request
# style: only code style changes
# comment: only comment changes
# refactor: code changes that do not affect the behavior
# perf: a code change that improves performance
# deps: bump deps used on compiling or runtime
# test: update test files
# cicd: update CI/CD configuration files.
# doc: documentation only changes
# wip: work in progress
# chore: bump test deps, modify build files, etc
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Takayuki Sato

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
115 changes: 115 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#!/usr/bin/env bash

errcheck() {
exitcd=$1
if [[ "$exitcd" != "0" ]]; then
exit $exitcd
fi
}

clean() {
mvn clean
errcheck $?
}

compile() {
mvn compile
errcheck $?
}

format() {
mvn formatter:format
errcheck $?
}

test() {
mvn test
errcheck $?
}

jar() {
mvn package
errcheck $?
}

javadoc() {
mvn javadoc:javadoc
errcheck $?
}

deps() {
mvn versions:display-dependency-updates
errcheck $?
}

sver() {
serialver -classpath target/classes $1
errcheck $?
}

trace_test() {
mvn -Ptrace test
errcheck $?
}

native_test() {
mvn -Pnative test
errcheck $?
}

deploy() {
mvn deploy
errcheck $?
}


if [[ "$#" == "0" ]]; then
clean
format
jar
javadoc
native_test
else
for a in "$@"; do
case "$a" in
clean)
clean
;;
compile)
compile
;;
format)
format
;;
test)
test
;;
jar)
jar
;;
javadoc)
javadoc
;;
deps)
deps
;;
sver)
sver $2
;;
'trace-test')
trace_test
;;
'native-test')
native_test
;;
deploy)
deploy
;;
*)
echo "Bad task: $a"
exit 1
;;
esac
done
fi

Loading