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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,5 @@ scripts/
# local.properties
build.log
.androidide
BUILD_GUIDE.md
.github/workflows/
9 changes: 5 additions & 4 deletions composite-builds/build-deps-common/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

pluginManagement {
repositories {
maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
maven { url = uri("https://maven.aliyun.com/repository/central") }
maven { url = uri("https://maven.aliyun.com/repository/google") }

gradlePluginPortal()
google()
mavenCentral()
maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
maven { url = uri("https://maven.aliyun.com/repository/central") }
maven { url = uri("https://maven.aliyun.com/repository/google") }
maven { url = uri("https://maven.aliyun.com/repository/public") }
}
}

dependencyResolutionManagement {
repositories {
maven { url = uri("https://maven.aliyun.com/repository/central") }
maven { url = uri("https://maven.aliyun.com/repository/google") }
maven { url = uri("https://maven.aliyun.com/repository/public") }

google()
mavenCentral()
Expand Down
13 changes: 7 additions & 6 deletions composite-builds/build-deps/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,21 @@ pluginManagement {
includeBuild("../build-logic")

repositories {
// maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
// maven { url = uri("https://maven.aliyun.com/repository/central") }
// maven { url = uri("https://maven.aliyun.com/repository/google") }

gradlePluginPortal()
google()
mavenCentral()
maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
maven { url = uri("https://maven.aliyun.com/repository/central") }
maven { url = uri("https://maven.aliyun.com/repository/google") }
maven { url = uri("https://maven.aliyun.com/repository/public") }
}
}

dependencyResolutionManagement {
repositories {
// maven { url = uri("https://maven.aliyun.com/repository/central") }
// maven { url = uri("https://maven.aliyun.com/repository/google") }
maven { url = uri("https://maven.aliyun.com/repository/central") }
maven { url = uri("https://maven.aliyun.com/repository/google") }
maven { url = uri("https://maven.aliyun.com/repository/public") }
google()
mavenCentral()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import org.gradle.api.provider.Provider
* For example, if the base version code of the IDE is 270 (for v2.7.0), then for arm64-v8a flavor,
* the version code will be `100 * 270 + 1` i.e. `27001`
*/
internal val flavorsAbis = mapOf("arm64-v8a" to 0, "armeabi-v7a" to 0)
internal val flavorsAbis = mapOf("arm64-v8a" to 0, "armeabi-v7a" to 1)

fun Project.configureAndroidModule(coreLibDesugDep: Provider<MinimalExternalModuleDependency>) {
val isAppModule = plugins.hasPlugin("com.android.application")
Expand Down Expand Up @@ -121,7 +121,7 @@ fun Project.configureAndroidModule(coreLibDesugDep: Provider<MinimalExternalModu
abi {
reset()
isEnable = true
isUniversalApk = false
isUniversalApk = true
include("arm64-v8a", "armeabi-v7a")
}
}
Expand All @@ -135,20 +135,16 @@ fun Project.configureAndroidModule(coreLibDesugDep: Provider<MinimalExternalModu
project.logger.info("Processing variant: ${variant.name}, ABI: $abiIdentifier")

if (abiIdentifier == null) {
project.logger.error("No ABI filter found for variant ${variant.name}")
throw IllegalStateException(
"ABI filter is required but missing for variant ${variant.name}"
)
output.versionCode.set(projectVersionCode)
} else {
val verCodeIncr = flavorsAbis[abiIdentifier]
if (verCodeIncr == null) {
throw UnsupportedOperationException(
"Unsupported ABI: $abiIdentifier. Only ARM architectures are supported: ${flavorsAbis.keys.joinToString()}"
)
}
output.versionCode.set(projectVersionCode + verCodeIncr)
}

val verCodeIncr = flavorsAbis[abiIdentifier]
if (verCodeIncr == null) {
throw UnsupportedOperationException(
"Unsupported ABI: $abiIdentifier. Only ARM architectures are supported: ${flavorsAbis.keys.joinToString()}"
)
}

output.versionCode.set(projectVersionCode + verCodeIncr)
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions composite-builds/build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
google()
mavenCentral()
maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
maven { url = uri("https://maven.aliyun.com/repository/central") }
maven { url = uri("https://maven.aliyun.com/repository/google") }
maven { url = uri("https://maven.aliyun.com/repository/public") }
}
}

dependencyResolutionManagement {

includeBuild("../build-deps-common") {
Expand All @@ -31,7 +44,10 @@ dependencyResolutionManagement {
repositories {
maven { url = uri("https://maven.aliyun.com/repository/central") }
maven { url = uri("https://maven.aliyun.com/repository/google") }
maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
maven { url = uri("https://maven.aliyun.com/repository/public") }

gradlePluginPortal()
google()
mavenCentral()
}
Expand Down
26 changes: 4 additions & 22 deletions core/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ buildscript {
}

tasks.configureEach {
if (name.contains("desugar", ignoreCase = true)) {
if (name.contains("desugar", ignoreCase = true) && !name.contains("FileDependencies", ignoreCase = true)) {
enabled = false
}
}
Expand Down Expand Up @@ -97,12 +97,12 @@ android {

buildTypes {
debug {
signingConfig = signingConfigs.getByName("custom")
}

release {
isShrinkResources = false
signingConfig = signingConfigs.getByName("custom")
isMinifyEnabled = false
signingConfig = null
}
}

Expand Down Expand Up @@ -131,25 +131,7 @@ android {
val abiFilter = filters.find { it.filterType == "ABI" }
val archSuffix =
abiFilter?.identifier
?: run {
val variantName = variant.name.lowercase()
when {
variantName.contains("arm64") -> "arm64-v8a"
variantName.contains("armeabi") || variantName.contains("arm7") -> "armeabi-v7a"
else -> {
// This should not happen with our configuration
throw IllegalStateException(
"Could not determine ABI for variant: $variantName. Expected arm64-v8a or armeabi-v7a."
)
}
}
}

if (archSuffix !in listOf("arm64-v8a", "armeabi-v7a")) {
throw IllegalStateException(
"Unsupported architecture: $archSuffix. Only arm64-v8a and armeabi-v7a are supported."
)
}
?: "universal"

val appName = "android-code-studio"
val fileName =
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ class ExtractAction(private val context: Context, override val order: Int) : Bas
val moduleNames = modules.map { it.name }.toTypedArray()

MaterialAlertDialogBuilder(context)
.setTitle("Select Module")
.setTitle(context.getString(R.string.atc_select_module))
.setItems(moduleNames) { dialog, which ->
val selectedModule = modules[which]
onModuleSelected(selectedModule)
dialog.dismiss()
}
.setNegativeButton("Cancel") { dialog, _ -> dialog.dismiss() }
.setNegativeButton(context.getString(R.string.action_cancel)) { dialog, _ -> dialog.dismiss() }
.show()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import com.tom.rv2ide.actions.ActionData
import com.tom.rv2ide.actions.ActionItem
import com.tom.rv2ide.actions.ActionMenu
import com.tom.rv2ide.actions.EditorActivityAction
import com.tom.rv2ide.R
import com.tom.rv2ide.R
import com.tom.rv2ide.resources.R as ResR
import com.tom.rv2ide.utils.TextTransformers
import io.github.rosemoe.sora.widget.CodeEditor
import org.slf4j.LoggerFactory
Expand Down Expand Up @@ -102,7 +103,7 @@ class ConvertToUppercaseAction(context: Context, override val order: Int) : Edit
}

init {
label = "Convert to uppercase"
label = context.getString(ResR.string.action_convert_to_uppercase)
icon = ContextCompat.getDrawable(context, R.drawable.ic_uppercase)
}

Expand All @@ -128,7 +129,7 @@ class ConvertToLowercaseAction(context: Context, override val order: Int) : Edit
override var requiresUIThread = true

init {
label = "Convert to lowercase"
label = context.getString(ResR.string.action_convert_to_lowercase)
icon = ContextCompat.getDrawable(context, R.drawable.ic_lowercase)
}

Expand All @@ -147,7 +148,7 @@ class DeleteLineAction(context: Context, override val order: Int) : EditorActivi
override var requiresUIThread = true

init {
label = "Delete line"
label = context.getString(ResR.string.action_delete_line)
icon = ContextCompat.getDrawable(context, R.drawable.ic_delete)
}

Expand All @@ -166,7 +167,7 @@ class DuplicateLineAction(context: Context, override val order: Int) : EditorAct
override var requiresUIThread = true

init {
label = "Duplicate line"
label = context.getString(ResR.string.action_duplicate_line)
icon = ContextCompat.getDrawable(context, R.drawable.ic_duplicate)
}

Expand All @@ -185,7 +186,7 @@ class CopyLineAction(private val context: Context, override val order: Int) : Ed
override var requiresUIThread = true

init {
label = "Copy line"
label = context.getString(ResR.string.action_copy_line)
icon = ContextCompat.getDrawable(context, R.drawable.ic_copy)
}

Expand All @@ -195,7 +196,7 @@ class CopyLineAction(private val context: Context, override val order: Int) : Ed
return false
}
TextTransformers(editor).copyLine()
Toast.makeText(context, "Copied to clipboard", Toast.LENGTH_SHORT).show()
Toast.makeText(context, ResR.string.msg_copied_to_clipboard, Toast.LENGTH_SHORT).show()
return true
}
}
Expand All @@ -205,7 +206,7 @@ class CommentLineAction(context: Context, override val order: Int) : EditorActiv
override var requiresUIThread = true

init {
label = "Comment line"
label = context.getString(ResR.string.action_comment_line)
icon = ContextCompat.getDrawable(context, R.drawable.ic_comment)
}

Expand All @@ -224,7 +225,7 @@ class MoveLineUpAction(context: Context, override val order: Int) : EditorActivi
override var requiresUIThread = true

init {
label = "Move line up"
label = context.getString(ResR.string.action_move_line_up)
icon = ContextCompat.getDrawable(context, R.drawable.ic_move_line_up)
}

Expand All @@ -243,7 +244,7 @@ class MoveLineDownAction(context: Context, override val order: Int) : EditorActi
override var requiresUIThread = true

init {
label = "Move line down"
label = context.getString(ResR.string.action_move_line_down)
icon = ContextCompat.getDrawable(context, R.drawable.ic_move_line_down)
}

Expand All @@ -262,7 +263,7 @@ class InsertLineAboveAction(context: Context, override val order: Int) : EditorA
override var requiresUIThread = true

init {
label = "Insert line above"
label = context.getString(ResR.string.action_insert_line_above)
icon = ContextCompat.getDrawable(context, R.drawable.ic_insert_line_above)
}

Expand All @@ -281,7 +282,7 @@ class InsertLineBelowAction(context: Context, override val order: Int) : EditorA
override var requiresUIThread = true

init {
label = "Insert line below"
label = context.getString(ResR.string.action_insert_line_below)
icon = ContextCompat.getDrawable(context, R.drawable.ic_insert_line_below)
}

Expand All @@ -300,7 +301,7 @@ class SelectLineAction(context: Context, override val order: Int) : EditorActivi
override var requiresUIThread = true

init {
label = "Select line"
label = context.getString(ResR.string.action_select_line)
icon = ContextCompat.getDrawable(context, R.drawable.ic_select_line)
}

Expand All @@ -319,7 +320,7 @@ class TrimTrailingWhitespaceAction(private val context: Context, override val or
override var requiresUIThread = true

init {
label = "Trim trailing whitespace"
label = context.getString(ResR.string.action_trim_trailing_whitespace)
icon = ContextCompat.getDrawable(context, R.drawable.ic_trim_trailing_whitespace)
}

Expand All @@ -329,7 +330,7 @@ class TrimTrailingWhitespaceAction(private val context: Context, override val or
return false
}
TextTransformers(editor).trimTrailingWhitespace()
Toast.makeText(context, "Trailing whitespace removed", Toast.LENGTH_SHORT).show()
Toast.makeText(context, ResR.string.msg_trailing_whitespace_removed, Toast.LENGTH_SHORT).show()
return true
}
}
Expand All @@ -339,7 +340,7 @@ class IndentLineAction(context: Context, override val order: Int) : EditorActivi
override var requiresUIThread = true

init {
label = "Indent line"
label = context.getString(ResR.string.action_indent_line)
icon = ContextCompat.getDrawable(context, R.drawable.ic_indent_line)
}

Expand All @@ -358,7 +359,7 @@ class UnindentLineAction(context: Context, override val order: Int) : EditorActi
override var requiresUIThread = true

init {
label = "Unindent line"
label = context.getString(ResR.string.action_unindent_line)
icon = ContextCompat.getDrawable(context, R.drawable.ic_unindent_line)
}

Expand All @@ -377,7 +378,7 @@ class JoinLinesAction(context: Context, override val order: Int) : EditorActivit
override var requiresUIThread = true

init {
label = "Join lines"
label = context.getString(ResR.string.action_join_lines)
icon = ContextCompat.getDrawable(context, R.drawable.ic_join_lines)
}

Expand All @@ -396,7 +397,7 @@ class ClearAllAction(private val context: Context, override val order: Int) : Ed
override var requiresUIThread = true

init {
label = "Clear all"
label = context.getString(ResR.string.action_clear_all)
icon = ContextCompat.getDrawable(context, R.drawable.ic_clear_all)
}

Expand All @@ -408,13 +409,13 @@ class ClearAllAction(private val context: Context, override val order: Int) : Ed
val activity = data.requireActivity()

MaterialAlertDialogBuilder(activity)
.setTitle("Clear All")
.setMessage("Are you sure you want to clear all text? This action cannot be undone.")
.setPositiveButton("Clear") { _, _ ->
.setTitle(ResR.string.title_clear_all)
.setMessage(ResR.string.msg_clear_all_confirm)
.setPositiveButton(ResR.string.btn_clear) { _, _ ->
TextTransformers(editor).clearAll()
Toast.makeText(context, "Editor cleared", Toast.LENGTH_SHORT).show()
Toast.makeText(context, ResR.string.msg_editor_cleared, Toast.LENGTH_SHORT).show()
}
.setNegativeButton("Cancel", null)
.setNegativeButton(android.R.string.cancel, null)
.show()

return true
Expand Down
Loading