Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/android-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ jobs:

- name: cargo clippy -D warnings
working-directory: ${{ env.CRATE_DIR }}
run: cargo clippy --all-targets -- -D warnings
run: cargo clippy --lib -- -D warnings

- name: cargo test
working-directory: ${{ env.CRATE_DIR }}
run: cargo test --all-targets
run: cargo test --lib

# 覆盖率:当前为信息性输出,不阻断 CI。
# TODO(A5):A5 出站层(crypto/proxy_proto/outbound)落地、整体代码量稳定后,
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
pull_request:
branches:
- main
paths:
- 'desktop/**'
- 'proxy-*/**'
- 'tun-adapter/**'
- 'pom.xml'

permissions:
contents: write
Expand Down
23 changes: 22 additions & 1 deletion android-app/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.gradle.api.tasks.Exec
import java.io.File
import java.io.FileInputStream
import java.util.Properties

Expand Down Expand Up @@ -120,7 +121,27 @@ val buildRust by tasks.registering(Exec::class) {
description = "Cross-compile plane-core (Rust) into jniLibs via cargo-ndk"
workingDir = rootProject.projectDir.parentFile // 仓库根目录(android-app 的上一级)
val profile = if (project.hasProperty("rustRelease")) "release" else "debug"
commandLine("bash", "scripts/build-rust.sh", profile)
val isWindows = System.getProperty("os.name").startsWith("Windows", ignoreCase = true)
val bashExecutable = if (isWindows) {
// Windows' PATH may resolve `bash` to WSL, which cannot reliably consume
// this checkout's paths. Prefer an explicit Git Bash installation.
val configured = providers.gradleProperty("gitBash").orNull
?: System.getenv("GIT_BASH")
val candidates = listOfNotNull(
configured?.let(::File),
System.getenv("ProgramFiles")?.let { File(it, "Git/bin/bash.exe") },
System.getenv("ProgramFiles(x86)")?.let { File(it, "Git/bin/bash.exe") },
System.getenv("LOCALAPPDATA")?.let { File(it, "Programs/Git/bin/bash.exe") },
)
candidates.firstOrNull(File::isFile)?.absolutePath
?: throw GradleException(
"Git Bash was not found. Install Git for Windows or set " +
"GIT_BASH / -PgitBash=C:\\path\\to\\bash.exe",
)
} else {
"bash"
}
commandLine(bashExecutable, "scripts/build-rust.sh", profile)
}

tasks.named("preBuild") {
Expand Down
Loading
Loading