Skip to content

Commit 5e7e8aa

Browse files
committed
initial commit
0 parents  commit 5e7e8aa

File tree

16 files changed

+777
-0
lines changed

16 files changed

+777
-0
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "**" ]
6+
paths-ignore:
7+
- '**/*.md'
8+
pull_request:
9+
branches: [ "**" ]
10+
paths-ignore:
11+
- '**/*.md'
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
name: Build Library
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Check out repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up JDK 17
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: '17'
27+
distribution: 'oracle'
28+
cache: gradle
29+
30+
- name: Grant execute permission for gradlew
31+
run: chmod +x gradlew
32+
33+
- name: Validate Gradle wrapper
34+
uses: gradle/actions/wrapper-validation@v4
35+
36+
- name: Library Tasks
37+
run: ./gradlew tasks
38+
39+
- name: Build Library
40+
run: ./gradlew build
41+
42+
- name: Upload build dir
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: amixfastcompiler
46+
path: build/

.github/workflows/deleteoldrus.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Delete old runs
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
days:
7+
description: 'Number of retains days.'
8+
required: true
9+
default: '0'
10+
minimum_runs:
11+
description: 'The minimum runs to keep for each workflow.'
12+
required: true
13+
default: '0'
14+
15+
jobs:
16+
deleteWorkflowRuns:
17+
name: Delete old workflow runs
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Delete workflow runs
21+
uses: Mattraks/delete-workflow-runs@v2.0.6
22+
with:
23+
token: ${{ github.token }}
24+
repository: ${{ github.repository }}
25+
retain_days: ${{ github.event.inputs.days }}
26+
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}

.github/workflows/format_code.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Code Formatter
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
format:
8+
name: Format Kotlin Code with ktfmt
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up JDK 22
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: 'oracle'
19+
java-version: '22'
20+
21+
- name: Download ktfmt
22+
run: |
23+
wget https://github.com/facebook/ktfmt/releases/download/v0.53/ktfmt-0.53-jar-with-dependencies.jar -O ktfmt.jar
24+
25+
- name: Run ktfmt on Kotlin files
26+
run: |
27+
find . -name "*.kt" -exec java -jar ktfmt.jar --google-style {} +
28+
29+
- name: Commit and Push changes
30+
run: |
31+
rm ktfmt.jar
32+
git config --global user.name "trindadedev13"
33+
git config --global user.email "trindadedev13@gmail.com"
34+
git fetch origin ${GITHUB_REF_NAME}:temp
35+
git add .
36+
git commit -m "chore: Format Kotlin Code" -m "format code with ktfmt in github actions"
37+
git rebase temp
38+
git push origin HEAD:${GITHUB_REF_NAME}
39+
env:
40+
TOKEN: ${{ secrets.SUPER_TOKEN }}
41+
continue-on-error: true
42+
43+
format-java:
44+
name: Format Java Code with Google Java Format
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v4
50+
51+
- name: Set up JDK 22
52+
uses: actions/setup-java@v4
53+
with:
54+
distribution: 'oracle'
55+
java-version: '22'
56+
57+
- name: Download Google Java Format
58+
run: |
59+
wget https://github.com/google/google-java-format/releases/download/v1.24.0/google-java-format-1.24.0-all-deps.jar -O google-java-format.jar
60+
61+
- name: Run Google Java Format in Java files
62+
run: |
63+
find . -name "*.java" -exec java -jar google-java-format.jar --replace {} +
64+
65+
- name: Commit and Push changes
66+
run: |
67+
rm google-java-format.jar
68+
git config --global user.name "trindadedev13"
69+
git config --global user.email "trindadedev13@gmail.com"
70+
git fetch origin ${GITHUB_REF_NAME}:temp
71+
git add .
72+
git commit -m "chore: Format Java Code" -m "format code with google java format in github actions"
73+
git rebase temp
74+
git push origin HEAD:${GITHUB_REF_NAME}
75+
env:
76+
TOKEN: ${{ secrets.SUPER_TOKEN }}
77+
continue-on-error: true

.gitignore

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Built application files
2+
*.apk
3+
*.aar
4+
*.ap_
5+
*.aab
6+
7+
# Files for the ART/Dalvik VM
8+
*.dex
9+
10+
# Java class files
11+
*.class
12+
13+
# Generated files
14+
/bin/
15+
/gen/
16+
/out/
17+
# Uncomment the following line in case you need and you don't have the release build type files in your app
18+
# Gradle files
19+
.gradle/
20+
/build/
21+
22+
# Local configuration file (sdk path, etc)
23+
local.properties
24+
25+
# Proguard folder generated by Eclipse
26+
proguard/
27+
28+
# Log Files
29+
*.log
30+
31+
# Android Studio Navigation editor temp files
32+
.navigation/
33+
34+
# Android Studio captures folder
35+
captures/
36+
37+
# IntelliJ
38+
*.iml
39+
.idea/workspace.xml
40+
.idea/tasks.xml
41+
.idea/gradle.xml
42+
.idea/assetWizardSettings.xml
43+
.idea/dictionaries
44+
.idea/libraries
45+
# Android Studio 3 in .gitignore file.
46+
.idea/caches
47+
.idea/modules.xml
48+
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
49+
.idea/navEditor.xml
50+
51+
# Keystore files
52+
# Uncomment the following lines if you do not want to check your keystore files in.
53+
#*.jks
54+
#*.keystore
55+
56+
# External native build folder generated in Android Studio 2.2 and later
57+
.externalNativeBuild
58+
.cxx/
59+
60+
# Google Services (e.g. APIs or Firebase)
61+
# google-services.json
62+
63+
# Freeline
64+
freeline.py
65+
freeline/
66+
freeline_project_description.json
67+
68+
# fastlane
69+
fastlane/report.xml
70+
fastlane/Preview.html
71+
fastlane/screenshots
72+
fastlane/test_output
73+
fastlane/readme.md
74+
75+
# Version control
76+
vcs.xml
77+
78+
# lint
79+
lint/intermediates/
80+
lint/generated/
81+
lint/outputs/
82+
lint/tmp/
83+
# lint/reports/
84+
85+
# For users who uses android ide for building app
86+
.androidide/
87+
/.androidide
88+
89+
.kotlin/

build.gradle.kts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* This file is part of Robok © 2024.
3+
*
4+
* Robok is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* Robok is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with Robok. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
19+
20+
plugins {
21+
alias(libs.plugins.kotlin)
22+
`java-library`
23+
}
24+
25+
group = "org.amix"
26+
version = libs.versions.lib.version.get()
27+
28+
java {
29+
sourceCompatibility = JavaVersion.VERSION_17
30+
targetCompatibility = JavaVersion.VERSION_17
31+
}
32+
33+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
34+
compilerOptions {
35+
jvmTarget.set(JvmTarget.JVM_17)
36+
}
37+
}
38+
39+
tasks.withType<Jar> {
40+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
41+
manifest { attributes["Main-Class"] = "org.amix.fastcompiler.MainKt" }
42+
43+
from({
44+
configurations.runtimeClasspath
45+
.get()
46+
.filter { it.exists() }
47+
.map { if (it.isDirectory) it else zipTree(it) }
48+
})
49+
}
50+
51+
tasks.build { dependsOn(tasks.jar) }
52+
53+
dependencies {
54+
implementation(libs.amix)
55+
}

cmd/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# How to use amixc.sh
2+
3+
```shellscript
4+
bash amixc.sh -verticalroot <true|false> <files>
5+
```

cmd/amixc.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
CACHE_DIR="$HOME/.amixc_cache"
4+
CACHE_FILE="$CACHE_DIR/amixc.jar"
5+
VERSION="1.0.0"
6+
7+
if [ ! -f "$CACHE_FILE" ]; then
8+
mkdir -p "$CACHE_DIR"
9+
echo "Downloading resources..."
10+
wget -q "https://github.com/AmixLang/AmixFastCompiler/releases/download/$VERSION/amixc.jar" -O "$CACHE_FILE" 2>/dev/null
11+
fi
12+
13+
if [ "$#" -lt 2 ]; then
14+
echo "Usage: $0 -verticalroot <value> <files>"
15+
exit 1
16+
fi
17+
18+
verticalRoot=""
19+
files=()
20+
21+
while (( "$#" )); do
22+
case "$1" in
23+
-verticalroot)
24+
verticalRoot="$2"
25+
shift 2
26+
;;
27+
*)
28+
files+=("$1")
29+
shift
30+
;;
31+
esac
32+
done
33+
34+
if [ -z "$verticalRoot" ]; then
35+
echo "Error: -verticalroot argument is required."
36+
exit 1
37+
fi
38+
39+
java -jar "$CACHE_FILE" -verticalroot "$verticalRoot" "${files[@]}"

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError

gradle/libs.versions.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[versions]
2+
kotlin = "2.1.0"
3+
lib-version = "1.0.0"
4+
amix = "1.0.0"
5+
6+
[plugins]
7+
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
8+
9+
[libraries]
10+
amix = { group = "com.github.AmixLang", name = "Amix", version.ref = "amix" }

gradle/wrapper/gradle-wrapper.jar

42.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)