Skip to content

Commit e9775a4

Browse files
committed
initial stuffs
1 parent 0bd6ec7 commit e9775a4

194 files changed

Lines changed: 12838 additions & 0 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
android:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Set up JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: temurin
19+
java-version: '21'
20+
21+
- name: Set up Rust stable
22+
uses: dtolnay/rust-toolchain@stable
23+
24+
- name: Cache Gradle
25+
uses: actions/cache@v4
26+
with:
27+
path: |
28+
~/.gradle/caches
29+
~/.gradle/wrapper
30+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'gradle/libs.versions.toml') }}
31+
restore-keys: |
32+
${{ runner.os }}-gradle-
33+
34+
- name: Cache Cargo
35+
uses: actions/cache@v4
36+
with:
37+
path: |
38+
~/.cargo/registry
39+
~/.cargo/git
40+
target
41+
key: ${{ runner.os }}-cargo-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}
42+
restore-keys: |
43+
${{ runner.os }}-cargo-
44+
45+
- name: Cache Android SDK / NDK / Konan
46+
uses: actions/cache@v4
47+
with:
48+
path: |
49+
~/.android
50+
~/android-sdk
51+
~/.konan
52+
key: ${{ runner.os }}-android-sdk-ndk-r27c
53+
54+
- name: Enable KVM permissions
55+
run: |
56+
sudo chown $USER /dev/kvm || true
57+
58+
- name: Create detekt placeholder if missing
59+
run: ./gradlew tasks --all
60+
61+
- name: Build and verify
62+
uses: reactivecircus/android-emulator-runner@v2
63+
with:
64+
api-level: 34
65+
arch: x86_64
66+
profile: pixel_6
67+
script: ./gradlew assembleDebug lintDebug testDebugUnitTest detekt connectedDebugAndroidTest

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ google-services.json
3232

3333
# Android Profiling
3434
*.hprof
35+
AGENTS.md
36+
plans/JCode_Plan 2.md
37+
plans/JCode_Verification 2.md
38+
plans/mock_ui.jpg

app-launch.png

1.63 MB
Loading

app/build.gradle.kts

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.kotlin.android)
4+
alias(libs.plugins.kotlin.compose)
5+
}
6+
7+
android {
8+
namespace = "dev.jcode"
9+
compileSdk = 36
10+
11+
defaultConfig {
12+
applicationId = "dev.jcode"
13+
minSdk = 33
14+
targetSdk = 36
15+
versionCode = 1
16+
versionName = "1.0"
17+
18+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
19+
}
20+
21+
buildTypes {
22+
release {
23+
isMinifyEnabled = false
24+
proguardFiles(
25+
getDefaultProguardFile("proguard-android-optimize.txt"),
26+
"proguard-rules.pro"
27+
)
28+
}
29+
}
30+
31+
compileOptions {
32+
sourceCompatibility = JavaVersion.VERSION_21
33+
targetCompatibility = JavaVersion.VERSION_21
34+
}
35+
36+
kotlinOptions {
37+
jvmTarget = "21"
38+
}
39+
40+
buildFeatures {
41+
compose = true
42+
}
43+
44+
ndkVersion = "27.2.12479018"
45+
}
46+
47+
dependencies {
48+
// Compose
49+
implementation(platform(libs.compose.bom))
50+
implementation(libs.compose.ui)
51+
implementation(libs.compose.ui.graphics)
52+
implementation(libs.compose.ui.tooling.preview)
53+
implementation(libs.compose.material3)
54+
implementation(libs.compose.material3.adaptive)
55+
implementation(libs.compose.material.icons.extended)
56+
57+
// AndroidX
58+
implementation(libs.core.ktx)
59+
implementation(libs.appcompat)
60+
implementation(libs.lifecycle.runtime.ktx)
61+
implementation(libs.lifecycle.runtime.compose)
62+
implementation(libs.activity.compose)
63+
64+
// Core modules
65+
implementation(project(":core:design"))
66+
implementation(project(":core:adaptive"))
67+
implementation(project(":core:fs"))
68+
implementation(project(":core:buffer"))
69+
implementation(project(":core:editor"))
70+
implementation(project(":core:editor-decor"))
71+
implementation(project(":core:editor-completion"))
72+
implementation(project(":core:treesitter"))
73+
implementation(project(":core:term"))
74+
implementation(project(":core:distro"))
75+
implementation(project(":core:lsp"))
76+
implementation(project(":core:ctags"))
77+
implementation(project(":core:debug"))
78+
implementation(project(":core:vcs"))
79+
implementation(project(":core:search"))
80+
implementation(project(":core:config"))
81+
implementation(project(":core:ext"))
82+
implementation(project(":core:state"))
83+
84+
// Feature modules
85+
implementation(project(":feature:explorer"))
86+
implementation(project(":feature:editor-pane"))
87+
implementation(project(":feature:terminal-pane"))
88+
implementation(project(":feature:problems"))
89+
implementation(project(":feature:scm"))
90+
implementation(project(":feature:search"))
91+
implementation(project(":feature:debug"))
92+
implementation(project(":feature:settings"))
93+
implementation(project(":feature:sdk-manager"))
94+
implementation(project(":feature:onboarding"))
95+
96+
// Native modules
97+
implementation(project(":native:buffer"))
98+
implementation(project(":native:editor-render"))
99+
implementation(project(":native:tree-sitter"))
100+
implementation(project(":native:libgit2"))
101+
implementation(project(":native:ripgrep-ffi"))
102+
implementation(project(":native:pty"))
103+
implementation(project(":native:vt"))
104+
implementation(project(":native:wasmtime-ffi"))
105+
106+
// Debug
107+
debugImplementation(libs.compose.ui.tooling)
108+
debugImplementation(libs.ui.test.manifest)
109+
110+
// Test
111+
testImplementation(libs.androidx.test.ext.junit)
112+
androidTestImplementation(platform(libs.compose.bom))
113+
androidTestImplementation(libs.ui.test.junit4)
114+
androidTestImplementation(libs.androidx.test.runner)
115+
androidTestImplementation(libs.androidx.test.espresso.core)
116+
}

app/proguard-rules.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Add project specific ProGuard rules here.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package dev.jcode
2+
3+
import androidx.test.ext.junit.runners.AndroidJUnit4
4+
import dev.jcode.native.buffer.BufferNativeModule
5+
import dev.jcode.native.editorrender.EditorRenderNativeModule
6+
import dev.jcode.native.libgit2.Libgit2NativeModule
7+
import dev.jcode.native.pty.PtyNativeModule
8+
import dev.jcode.native.ripgrepffi.RipgrepFfiNativeModule
9+
import dev.jcode.native.treesitter.TreeSitterNativeModule
10+
import dev.jcode.native.vt.VtNativeModule
11+
import dev.jcode.native.wasmtimeffi.WasmtimeFfiNativeModule
12+
import org.junit.Test
13+
import org.junit.runner.RunWith
14+
15+
@RunWith(AndroidJUnit4::class)
16+
class NativeLibrariesSmokeTest {
17+
18+
@Test
19+
fun loadsAllNativeLibraries() {
20+
BufferNativeModule.loadLibrary()
21+
EditorRenderNativeModule.loadLibrary()
22+
TreeSitterNativeModule.loadLibrary()
23+
Libgit2NativeModule.loadLibrary()
24+
RipgrepFfiNativeModule.loadLibrary()
25+
PtyNativeModule.loadLibrary()
26+
VtNativeModule.loadLibrary()
27+
WasmtimeFfiNativeModule.loadLibrary()
28+
}
29+
}

app/src/main/AndroidManifest.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
5+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
6+
<uses-permission android:name="com.termux.permission.RUN_COMMAND" />
7+
8+
<queries>
9+
<package android:name="com.termux" />
10+
<package android:name="com.termux.api" />
11+
</queries>
12+
13+
<application
14+
android:allowBackup="false"
15+
android:icon="@android:drawable/sym_def_app_icon"
16+
android:label="J Code"
17+
android:supportsRtl="true"
18+
android:theme="@android:style/Theme.Material.Light.NoActionBar">
19+
20+
<activity
21+
android:name=".MainActivity"
22+
android:exported="true"
23+
android:windowSoftInputMode="adjustResize">
24+
<intent-filter>
25+
<action android:name="android.intent.action.MAIN" />
26+
<category android:name="android.intent.category.LAUNCHER" />
27+
</intent-filter>
28+
</activity>
29+
30+
<service
31+
android:name=".BackendService"
32+
android:exported="false"
33+
android:foregroundServiceType="specialUse"
34+
android:stopWithTask="false">
35+
<property
36+
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
37+
android:value="interactive_terminal_and_build_runner" />
38+
</service>
39+
40+
</application>
41+
42+
</manifest>

0 commit comments

Comments
 (0)