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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
116 changes: 102 additions & 14 deletions .github/workflows/asm_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,23 @@ on:
options:
- Debug
- Release
version:
description: 'Release version'
required: true
default: 'v1.0.0+gh.r05'
type: string
version_code:
description: 'Version code (empty = major*1000 + revision*10)'
required: false
default: ''
type: string

jobs:
build_release_apk:
name: Build APK
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.12.1
Expand All @@ -52,15 +64,46 @@ jobs:
BUILD_TYPE="${SELECTED_TYPE:-Debug}"
echo "BUILD_TYPE=$BUILD_TYPE" >> $GITHUB_ENV
echo "BUILD_TYPE_LOWER=$(echo "$BUILD_TYPE" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
INPUT_VERSION="${{ github.event.inputs.version }}"
RAW_VERSION="${INPUT_VERSION:-v1.0.0+gh.r05}"
CLEAN_VERSION="${RAW_VERSION#v}"
echo "VERSION=$RAW_VERSION" >> $GITHUB_ENV
echo "MAIN_VERSION=${CLEAN_VERSION%%+*}" >> $GITHUB_ENV
echo "REVISION_NUM=${CLEAN_VERSION##*.r}" >> $GITHUB_ENV
INPUT_VERSION_CODE="${{ github.event.inputs.version_code }}"
DEFAULT_CODE=$(( ${CLEAN_VERSION%%.*} * 1000 + 10 * 10#${CLEAN_VERSION##*.r} ))
echo "VERSION_CODE=${INPUT_VERSION_CODE:-$DEFAULT_CODE}" >> $GITHUB_ENV

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'

- name: Install Android SDK platform 37
run: |
SDKMANAGER="$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager"
yes | "$SDKMANAGER" --licenses > /dev/null || true
"$SDKMANAGER" --list 2>/dev/null | grep -i "platforms;android-37" || true
for pkg in "platforms;android-37.0" "platforms;android-37"; do
"$SDKMANAGER" "$pkg" && break
done
cd "$ANDROID_HOME/platforms"
ls
if [ ! -d android-37 ] && [ -d android-37.0 ]; then
ln -s android-37.0 android-37
fi
test -f android-37/android.jar

- name: Generating missing dirs
run: mkdir -p /home/runner/work/android-code-studio/android-code-studio/core/app/build/intermediates/external_file_lib_dex_archives/debug/desugarDebugFileDependencies && mkdir -p /home/runner/work/android-code-studio/android-code-studio/core/app/build/intermediates/l8_art_profile/release/l8DexDesugarLibRelease
run: |
mkdir -p /home/runner/work/android-code-studio/android-code-studio/core/app/build/intermediates/external_file_lib_dex_archives/debug/desugarDebugFileDependencies
mkdir -p /home/runner/work/android-code-studio/android-code-studio/core/app/build/intermediates/external_file_lib_dex_archives/release/desugarReleaseFileDependencies
mkdir -p /home/runner/work/android-code-studio/android-code-studio/core/app/build/intermediates/l8_art_profile/release/l8DexDesugarLibRelease
mkdir -p /home/runner/work/android-code-studio/android-code-studio/composite-builds/build-logic/desugaring-core
mkdir -p /home/runner/work/android-code-studio/android-code-studio/core/app/build/intermediates/l8_art_profile/release/l8DexDesugarLibRelease
touch /home/runner/work/android-code-studio/android-code-studio/core/app/build/intermediates/l8_art_profile/release/l8DexDesugarLibRelease/baseline-prof.txt


- name: Change Gradle wrapper permissions
run: chmod +x ./gradlew
Expand All @@ -75,6 +118,38 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-

- name: Generate no-sign init script
run: |
cat > ~/no-sign.init.gradle << 'EOF'
gradle.projectsEvaluated {
rootProject.allprojects { p ->
def s = p.extensions.findByName("signing")
if (s != null) {
s.required = false
}
}
}
EOF

- name: Build and publish sora-editor to Maven Local
run: |
git clone --depth 1 https://github.com/nullij/sora-editor.git ~/sora-editor
cd ~/sora-editor
VERSIONS_FILE=build-logic/convention/src/main/kotlin/Versions.kt
sed -i 's/private const val version = "0.24.6"/private const val version = "0.24.7-acs"/' "$VERSIONS_FILE"
sed -i 's/const val versionCode = 95/const val versionCode = 96/' "$VERSIONS_FILE"
grep -nE 'const val (version|versionCode) =' "$VERSIONS_FILE"
chmod +x ./gradlew
./gradlew :editor:publishToMavenLocal -I ~/no-sign.init.gradle
find ~/.m2/repository -name "*.pom" | grep -i editor

- name: Point editor version to snapshot
run: |
for f in $(find . -name "libs.versions.toml" -not -path "*/build/*"); do
sed -i 's/^\(editor = \)"0.24.7-acs"/\1"0.24.7-acs-SNAPSHOT"/' "$f"
grep -n '^editor = ' "$f"
done

- name: Create local.properties
run: |
echo "signing.storeFile=signing/signing-key.jks" >> local.properties
Expand All @@ -86,7 +161,24 @@ jobs:
env:
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
run: ./gradlew assemble${{ env.BUILD_TYPE }}
run: |
env SIGNING_STORE_PASSWORD="$SIGNING_STORE_PASSWORD" \
SIGNING_KEY_PASSWORD="$SIGNING_KEY_PASSWORD" \
PROJECT_CONFIG_KT_BASE_VERSION_CODE="$VERSION_CODE" \
REVISION_NUM="$REVISION_NUM" \
MAIN_VERSION="$MAIN_VERSION" \
./gradlew assemble${{ env.BUILD_TYPE }} -DMAIN_VERSION="$MAIN_VERSION" -DREVISION_NUM="$REVISION_NUM" -DANDROID_VERSION_CODE="$VERSION_CODE" -DPROJECT_CONFIG_KT_BASE_VERSION_CODE="$VERSION_CODE" -DSIGNING_STORE_PASSWORD="$SIGNING_STORE_PASSWORD" -DSIGNING_KEY_PASSWORD="$SIGNING_KEY_PASSWORD"

- name: Rename APKs
run: |
cd core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}
for abi in arm64-v8a armeabi-v7a x86_64 universal; do
for f in *"$abi"*.apk; do
if [ -f "$f" ]; then
mv "$f" "android-code-studio-${abi}-${BUILD_TYPE_LOWER}-${VERSION}.apk"
fi
done
done

- name: List APK files
run: ls -la core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/ || echo "Directory not found"
Expand All @@ -105,16 +197,12 @@ jobs:
path: core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/*armeabi-v7a*.apk
if: always()

- name: Upload x86_64 APK
uses: actions/upload-artifact@v4
with:
name: apk-x86_64-${{ env.BUILD_TYPE_LOWER }}
path: core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/*x86_64*.apk
if: always()

- name: Upload universal APK
uses: actions/upload-artifact@v4
- name: Publish GitHub Release
if: env.BUILD_TYPE == 'Release'
uses: softprops/action-gh-release@v2
with:
name: apk-universal-${{ env.BUILD_TYPE_LOWER }}
path: core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/*universal*.apk
if: always()
tag_name: ${{ env.VERSION }}
name: ${{ env.VERSION }}
target_commitish: ${{ github.sha }}
fail_on_unmatched_files: true
files: core/app/build/outputs/apk/release/android-code-studio-*.apk
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ lint.sh
fmt.sh
clear_runs.py
autopush.sh
server
/server
local.properties

# Crowdin
Expand Down Expand Up @@ -110,3 +110,4 @@ build.log

external/logwire/build
external/atc/build
external/acsprovider/build
4 changes: 2 additions & 2 deletions annotation/processors-ksp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
kotlin("kapt")
// kotlin("kapt")
}



dependencies {
kapt(libs.google.auto.service)
// kapt(libs.google.auto.service)
implementation(libs.google.auto.service.annotations)

implementation(kotlin("stdlib"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.tom.rv2ide.annotations.ksp.inflater.ViewAdapterSymbolProcessorProvider
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ buildscript {

project.group = BuildConfig.packageName

subprojects {
configurations.configureEach {
exclude(
group = "org.jetbrains.kotlin",
module = "kotlin-android-extensions-runtime"
)
}
}

subprojects {
if (project != rootProject) {
var group = project.parent!!.group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
1 change: 0 additions & 1 deletion composite-builds/build-deps/appintro/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id("com.android.library")
id("kotlin-android")
id("com.tom.rv2ide.build")
}

Expand Down
4 changes: 2 additions & 2 deletions composite-builds/build-deps/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ subprojects {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

buildTypes.register("dev") {
Expand Down
4 changes: 3 additions & 1 deletion composite-builds/build-deps/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=true
android.useAndroidX=true
android.enableJetifier=false
android.enableJetifier=false
android.newDsl=false

13 changes: 6 additions & 7 deletions composite-builds/build-deps/javac/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ plugins {
id("java-library")
}

configurations.all {
resolutionStrategy {
cacheChangingModulesFor(0, "seconds")
}
}
// configurations.all {
// resolutionStrategy {
// cacheChangingModulesFor(0, "seconds")
// }
// }


dependencies {
api(files("../libs/java-compiler.jar"))
api(files("../libs/jdk-compiler.jar"))
// api(projects.buildDeps.jdkCompiler)
api(projects.buildDeps.jdkCompiler)
}
3 changes: 2 additions & 1 deletion composite-builds/build-deps/jdk-compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ java {
}

dependencies {
api(projects.buildDeps.javaCompiler)
api(files("../libs/java-compiler.jar"))
// api(projects.buildDeps.javaCompiler)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

package openjdk.tools.sjavac.server;

import java.io.Serializable;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import openjdk.tools.javac.main.Main.Result;
import openjdk.tools.sjavac.pubapi.PubApi;

/**
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
public class CompilationSubResult implements Serializable {

static final long serialVersionUID = 46739181113L;

public Result result;
public Map<String, Set<URI>> packageArtifacts = new HashMap<>();
public Map<String, Map<String, Set<String>>> packageDependencies = new HashMap<>();
public Map<String, Map<String, Set<String>>> packageCpDependencies = new HashMap<>();
public Map<String, PubApi> packagePubapis = new HashMap<>();
public Map<String, PubApi> dependencyPubapis = new HashMap<>();
public String stdout = "";
public String stderr = "";

public CompilationSubResult(Result result) {
this.result = result;
}

public void setResult(Result result) {
this.result = result;
}
}
Loading
Loading