Skip to content
This repository was archived by the owner on Aug 4, 2024. It is now read-only.

Commit b0bd6ad

Browse files
committed
Initial commit
0 parents  commit b0bd6ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4708
-0
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ensure java and rust files use LF
2+
*.java eol=lf
3+
*.rs eol=lf

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: build
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
pull_request:
6+
branches: [ "master" ]
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up JDK 11
15+
uses: actions/setup-java@v3
16+
with:
17+
java-version: '11'
18+
distribution: 'temurin'
19+
- name: Install Rust toolchain
20+
uses: actions-rs/toolchain@v1
21+
with:
22+
toolchain: stable
23+
- name: Cache osxcross toolchain
24+
uses: actions/cache@v3
25+
with:
26+
path: |
27+
./osxcross/target/
28+
key: ${{ runner.os }}-osxcross-${{ hashFiles('ci-setup.sh') }}
29+
- name: Make CI script executable
30+
run: chmod +x ./ci-setup.sh
31+
- name: Execute CI script
32+
run: ./ci-setup.sh
33+
- name: Add osxcross to PATH
34+
run: echo "$(pwd)/osxcross/target/bin" >> $GITHUB_PATH
35+
- name: Validate Gradle wrapper
36+
uses: gradle/wrapper-validation-action@v1
37+
- name: Make gradlew executable
38+
run: chmod +x ./gradlew
39+
- name: Test with Gradle
40+
uses: gradle/gradle-build-action@v1
41+
with:
42+
arguments: test
43+
env:
44+
CSJ_FULL_BUILD: 1

.github/workflows/publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: publish
2+
on:
3+
release:
4+
types: [ "created" ]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
packages: write
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up JDK 11
14+
uses: actions/setup-java@v3
15+
with:
16+
java-version: '11'
17+
distribution: 'temurin'
18+
- name: Install Rust toolchain
19+
uses: actions-rs/toolchain@v1
20+
with:
21+
toolchain: stable
22+
- name: Cache osxcross toolchain
23+
uses: actions/cache@v3
24+
with:
25+
path: |
26+
./osxcross/target/
27+
key: ${{ runner.os }}-osxcross-${{ hashFiles('ci-setup.sh') }}
28+
- name: Make CI script executable
29+
run: chmod +x ./ci-setup.sh
30+
- name: Execute CI script
31+
run: ./ci-setup.sh
32+
- name: Add osxcross to PATH
33+
run: echo "$(pwd)/osxcross/target/bin" >> $GITHUB_PATH
34+
- name: Validate Gradle wrapper
35+
uses: gradle/wrapper-validation-action@v1
36+
- name: Make gradlew executable
37+
run: chmod +x ./gradlew
38+
- name: Publish package
39+
uses: gradle/gradle-build-action@v1
40+
with:
41+
arguments: publish
42+
env:
43+
CSJ_FULL_BUILD: 1
44+
CSJ_VERSION: ${{ github.ref_name }}
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

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

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2023 The Native4J Authors. All rights reserved.
2+
3+
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:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
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.

LICENSEHEADER

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
* Copyright 2023 The Native4J Authors
3+
*
4+
* Use of this source code is governed by the MIT license found in the LICENSE file.
5+
*/

build.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
def project_version = "dev"
2+
3+
def version_override = System.getenv("CSJ_VERSION")
4+
if (version_override != null) {
5+
// Remove leading "v" if present
6+
if (version_override.startsWith("v"))
7+
version_override = version_override.substring(1)
8+
project_version = version_override.trim()
9+
}
10+
11+
allprojects {
12+
group = "org.native4j"
13+
version = project_version
14+
}
15+
16+
subprojects {
17+
project.ext {
18+
is_full_build = System.getenv("CSJ_FULL_BUILD") == "1"
19+
}
20+
}

ci-setup.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
sudo apt update -y
4+
5+
# Install dependencies
6+
sudo apt install -y build-essential \
7+
git \
8+
wget \
9+
cmake \
10+
mingw-w64 \
11+
gcc-arm-linux-gnueabihf \
12+
gcc-aarch64-linux-gnu \
13+
gcc-i686-linux-gnu \
14+
15+
# Install Rust targets
16+
rustup target add x86_64-pc-windows-gnu
17+
rustup target add i686-pc-windows-gnu
18+
19+
rustup target add x86_64-unknown-linux-gnu
20+
rustup target add i686-unknown-linux-gnu
21+
22+
rustup target add aarch64-unknown-linux-gnu
23+
rustup target add arm-unknown-linux-gnueabihf
24+
25+
rustup target add x86_64-apple-darwin
26+
rustup target add aarch64-apple-darwin
27+
28+
setup_osxcross() {
29+
# Set up OSX cross compilation toolchain
30+
git clone https://github.com/tpoechtrager/osxcross
31+
cd osxcross
32+
33+
# Install osxcross dependencies
34+
./tools/get_dependencies.sh
35+
36+
# Download Big Sur 11.1 SDK
37+
wget -nc https://github.com/joseluisq/macosx-sdks/releases/download/11.1/MacOSX11.1.sdk.tar.xz
38+
mv MacOSX11.1.sdk.tar.xz tarballs/
39+
40+
# Build clang
41+
UNATTENDED=yes OSX_VERSION_MIN=11.1 ./build.sh
42+
43+
cd ../
44+
}
45+
46+
if [ ! -d "osxcross/target" ]; then
47+
setup_osxcross
48+
fi

0 commit comments

Comments
 (0)