refactor: update to aliucord-gradle 2
This commit is contained in:
parent
2b687cea21
commit
5df56646c7
20 changed files with 150 additions and 141 deletions
122
build.gradle.kts
122
build.gradle.kts
|
|
@ -1,86 +1,78 @@
|
||||||
|
@file:Suppress("UnstableApiUsage")
|
||||||
|
|
||||||
import com.aliucord.gradle.AliucordExtension
|
import com.aliucord.gradle.AliucordExtension
|
||||||
import com.android.build.gradle.BaseExtension
|
import com.android.build.gradle.LibraryExtension
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidExtension
|
||||||
|
import org.jlleitschuh.gradle.ktlint.KtlintExtension
|
||||||
|
|
||||||
buildscript {
|
plugins {
|
||||||
repositories {
|
alias(libs.plugins.kotlin.android) apply false
|
||||||
google()
|
alias(libs.plugins.android.library) apply false
|
||||||
mavenCentral()
|
alias(libs.plugins.aliucord.plugin) apply true
|
||||||
maven("https://maven.aliucord.com/snapshots")
|
alias(libs.plugins.ktlint) apply false
|
||||||
gradlePluginPortal() // remove when gradle 8
|
alias(libs.plugins.shadow) apply false
|
||||||
maven("https://jitpack.io")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("com.android.tools.build:gradle:7.1.3")
|
|
||||||
classpath("com.aliucord:gradle:main-SNAPSHOT")
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21")
|
|
||||||
// classpath("com.gradleup.shadow:shadow-gradle-plugin:8.3.8")
|
|
||||||
classpath("com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:7.1.2") // For Gradle 7 compat
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
mavenCentral()
|
|
||||||
maven("https://maven.aliucord.com/snapshots")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.aliucord(configuration: AliucordExtension.() -> Unit) = extensions.getByName<AliucordExtension>("aliucord").configuration()
|
|
||||||
|
|
||||||
fun Project.android(configuration: BaseExtension.() -> Unit) = extensions.getByName<BaseExtension>("android").configuration()
|
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
apply(plugin = "com.android.library")
|
val libs = rootProject.libs
|
||||||
apply(plugin = "com.aliucord.gradle")
|
|
||||||
apply(plugin = "kotlin-android")
|
|
||||||
|
|
||||||
aliucord {
|
apply {
|
||||||
author("Lava", 368398754077868032L)
|
plugin(libs.plugins.android.library.get().pluginId)
|
||||||
updateUrl.set("https://raw.githubusercontent.com/LavaDesu/Awoocord/builds/updater.json")
|
plugin(libs.plugins.aliucord.plugin.get().pluginId)
|
||||||
buildUrl.set("https://raw.githubusercontent.com/LavaDesu/Awoocord/builds/%s.zip")
|
plugin(libs.plugins.kotlin.android.get().pluginId)
|
||||||
|
plugin(libs.plugins.ktlint.get().pluginId)
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
configure<LibraryExtension> {
|
||||||
compileSdkVersion(31)
|
compileSdk = 36
|
||||||
|
namespace = "moe.lava.awoocord"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk = 24
|
minSdk = 21
|
||||||
targetSdk = 31
|
}
|
||||||
|
|
||||||
|
buildFeatures {
|
||||||
|
aidl = false
|
||||||
|
buildConfig = true
|
||||||
|
renderScript = false
|
||||||
|
shaders = false
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_21
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
targetCompatibility = JavaVersion.VERSION_21
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "11"
|
|
||||||
// Disables some unnecessary features
|
|
||||||
freeCompilerArgs = freeCompilerArgs +
|
|
||||||
"-Xno-call-assertions" +
|
|
||||||
"-Xno-param-assertions" +
|
|
||||||
"-Xno-receiver-assertions"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configure<AliucordExtension> {
|
||||||
|
author("Lava", 368398754077868032L, hyperlink = true)
|
||||||
|
github("https://github.com/LavaDesu/Awoocord")
|
||||||
|
}
|
||||||
|
|
||||||
|
configure<KtlintExtension> {
|
||||||
|
version.set(libs.versions.ktlint.asProvider())
|
||||||
|
|
||||||
|
coloredOutput.set(true)
|
||||||
|
outputColorName.set("RED")
|
||||||
|
ignoreFailures.set(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
configure<KotlinAndroidExtension> {
|
||||||
|
compilerOptions {
|
||||||
|
jvmTarget = JvmTarget.JVM_21
|
||||||
|
optIn.add("kotlin.RequiresOptIn")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
dependencies {
|
dependencies {
|
||||||
val discord by configurations
|
val compileOnly by configurations
|
||||||
val implementation by configurations
|
val implementation by configurations
|
||||||
|
|
||||||
// Stubs for all Discord classes
|
compileOnly(libs.discord)
|
||||||
discord("com.discord:discord:aliucord-SNAPSHOT")
|
compileOnly(libs.aliucord)
|
||||||
implementation("com.aliucord:Aliucord:2.5.0")
|
compileOnly(libs.aliuhook)
|
||||||
|
compileOnly(libs.kotlin.stdlib)
|
||||||
implementation("androidx.appcompat:appcompat:1.4.0")
|
|
||||||
implementation("com.google.android.material:material:1.4.0")
|
|
||||||
implementation("androidx.constraintlayout:constraintlayout:2.1.2")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task<Delete>("clean") {
|
|
||||||
delete(rootProject.buildDir)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
version = "8.8.0"
|
version = "8.8.0"
|
||||||
description = "Beta backport of ComponentsV2"
|
description = "Beta backport of ComponentsV2"
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "moe.lava.corenary.componentsv2"
|
||||||
|
}
|
||||||
|
|
||||||
aliucord {
|
aliucord {
|
||||||
// Changelog of your plugin
|
// Changelog of your plugin
|
||||||
changelog.set("""
|
changelog.set("""
|
||||||
|
|
@ -28,11 +32,12 @@ aliucord {
|
||||||
* Initial release >w<
|
* Initial release >w<
|
||||||
""".trimIndent())
|
""".trimIndent())
|
||||||
|
|
||||||
excludeFromUpdaterJson.set(false)
|
deploy.set(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//apply(plugin = "com.gradleup.shadow")
|
apply {
|
||||||
apply(plugin = "com.github.johnrengelman.shadow") // remove when gradle 8
|
plugin(libs.plugins.shadow.get().pluginId)
|
||||||
|
}
|
||||||
|
|
||||||
val shadowDir = File(buildDir, "intermediates/shadowed")
|
val shadowDir = File(buildDir, "intermediates/shadowed")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest package="moe.lava.awoocanary.componentsv2" />
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
@file:Suppress("MISSING_DEPENDENCY_CLASS", "MISSING_DEPENDENCY_SUPERCLASS")
|
|
||||||
|
|
||||||
package com.aliucord.coreplugins.componentsv2.selectsheet
|
package com.aliucord.coreplugins.componentsv2.selectsheet
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
|
@ -16,6 +14,7 @@ import com.discord.utilities.view.extensions.ViewExtensions
|
||||||
import com.discord.utilities.view.recycler.MaxHeightRecyclerView
|
import com.discord.utilities.view.recycler.MaxHeightRecyclerView
|
||||||
import com.discord.widgets.botuikit.views.select.`SelectComponentBottomSheet$binding$2`
|
import com.discord.widgets.botuikit.views.select.`SelectComponentBottomSheet$binding$2`
|
||||||
import com.lytefast.flexinput.R
|
import com.lytefast.flexinput.R
|
||||||
|
import b.a.k.b as FormatUtils
|
||||||
|
|
||||||
internal class SelectSheet : AppBottomSheet {
|
internal class SelectSheet : AppBottomSheet {
|
||||||
val entry: BotUiComponentV2Entry?
|
val entry: BotUiComponentV2Entry?
|
||||||
|
|
@ -71,7 +70,7 @@ internal class SelectSheet : AppBottomSheet {
|
||||||
|
|
||||||
if (state.isMultiSelect) {
|
if (state.isMultiSelect) {
|
||||||
subtitle.text =
|
subtitle.text =
|
||||||
b.a.k.b.k(
|
FormatUtils.k(
|
||||||
this,
|
this,
|
||||||
R.h.message_select_component_select_requirement,
|
R.h.message_select_component_select_requirement,
|
||||||
arrayOf(state.minSelections),
|
arrayOf(state.minSelections),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
@file:Suppress("MISSING_DEPENDENCY_CLASS", "MISSING_DEPENDENCY_SUPERCLASS")
|
|
||||||
|
|
||||||
package com.aliucord.coreplugins.componentsv2.selectsheet
|
package com.aliucord.coreplugins.componentsv2.selectsheet
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
@file:Suppress("MISSING_DEPENDENCY_CLASS", "MISSING_DEPENDENCY_SUPERCLASS")
|
|
||||||
|
|
||||||
package com.aliucord.coreplugins.componentsv2.views
|
package com.aliucord.coreplugins.componentsv2.views
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,12 @@ aliucord {
|
||||||
* Initial port >w< thanks @jedenastka
|
* Initial port >w< thanks @jedenastka
|
||||||
""".trimIndent())
|
""".trimIndent())
|
||||||
|
|
||||||
excludeFromUpdaterJson.set(false)
|
deploy.set(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//apply(plugin = "com.gradleup.shadow")
|
apply {
|
||||||
apply(plugin = "com.github.johnrengelman.shadow") // remove when gradle 8
|
plugin(libs.plugins.shadow.get().pluginId)
|
||||||
|
}
|
||||||
|
|
||||||
val shadowDir = File(buildDir, "intermediates/shadowed")
|
val shadowDir = File(buildDir, "intermediates/shadowed")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest package="moe.lava.corenary.slashcommandsfix" />
|
|
||||||
|
|
@ -1,19 +1,12 @@
|
||||||
# Project-wide Gradle settings.
|
# Gradle
|
||||||
# IDE (e.g. Android Studio) users:
|
org.gradle.caching=true
|
||||||
# Gradle settings configured through the IDE *will override*
|
org.gradle.configuration-cache=true
|
||||||
# any settings specified in this file.
|
org.gradle.configureondemand=true
|
||||||
# For more details on how to configure your build environment visit
|
org.gradle.parallel=true
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
|
||||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# Kotlin
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
kotlin.code.style=official
|
||||||
# org.gradle.parallel=true
|
|
||||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
# Android
|
||||||
# Android operating system, and which are packaged with your app"s APK
|
|
||||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
# Automatically convert third-party libraries to use AndroidX
|
|
||||||
android.enableJetifier=true
|
|
||||||
|
|
|
||||||
25
gradle/libs.versions.toml
Normal file
25
gradle/libs.versions.toml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
[versions]
|
||||||
|
aliucord = "2.6.0"
|
||||||
|
aliuhook = "1.1.4"
|
||||||
|
aliucord-gradle = "2.3.0"
|
||||||
|
android = "8.13.0"
|
||||||
|
discord = "126021"
|
||||||
|
kotlin = "2.2.20"
|
||||||
|
#noinspection GradleDependency
|
||||||
|
kotlin-stdlib = "1.5.21"
|
||||||
|
ktlint = "1.7.1"
|
||||||
|
ktlint-plugin = "13.1.0"
|
||||||
|
shadow = "8.3.8"
|
||||||
|
|
||||||
|
[libraries]
|
||||||
|
aliucord = { module = "com.aliucord:Aliucord", version.ref = "aliucord" }
|
||||||
|
aliuhook = { module = "com.aliucord:Aliuhook", version.ref = "aliuhook" }
|
||||||
|
discord = { module = "com.discord:discord", version.ref = "discord" }
|
||||||
|
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin-stdlib" }
|
||||||
|
|
||||||
|
[plugins]
|
||||||
|
aliucord-plugin = { id = "com.aliucord.plugin", version.ref = "aliucord-gradle" }
|
||||||
|
android-library = { id = "com.android.library", version.ref = "android" }
|
||||||
|
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||||
|
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint-plugin" }
|
||||||
|
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
|
||||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -1,6 +1,8 @@
|
||||||
#Wed May 28 17:22:29 GMT 2025
|
#Wed May 28 17:22:29 GMT 2025
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
description = "Backported and improved search functionality"
|
description = "Backported and improved search functionality"
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "moe.lava.awoocord.scout"
|
||||||
|
}
|
||||||
|
|
||||||
aliucord {
|
aliucord {
|
||||||
// Changelog of your plugin
|
// Changelog of your plugin
|
||||||
changelog.set("""
|
changelog.set("""
|
||||||
|
|
@ -43,5 +47,5 @@ aliucord {
|
||||||
* Initial release >w<
|
* Initial release >w<
|
||||||
""".trimIndent())
|
""".trimIndent())
|
||||||
|
|
||||||
excludeFromUpdaterJson.set(false)
|
deploy.set(true)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest package="moe.lava.awoocord.scout" />
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
package com.discord.restapi
|
|
||||||
|
|
||||||
// Stub
|
|
||||||
@Suppress("ClassName")
|
|
||||||
abstract class `RequiredHeadersInterceptor$HeadersProvider` {}
|
|
||||||
|
|
@ -13,20 +13,15 @@ import com.aliucord.utils.DimenUtils.dp
|
||||||
import com.aliucord.utils.ViewUtils.findViewById
|
import com.aliucord.utils.ViewUtils.findViewById
|
||||||
import com.aliucord.wrappers.ChannelWrapper.Companion.id
|
import com.aliucord.wrappers.ChannelWrapper.Companion.id
|
||||||
import com.discord.BuildConfig
|
import com.discord.BuildConfig
|
||||||
import com.discord.api.channel.Channel
|
import com.discord.api.channel.*
|
||||||
import com.discord.api.channel.ChannelUtils
|
|
||||||
import com.discord.api.channel.`ChannelUtils$getSortByNameAndType$1`
|
|
||||||
import com.discord.api.permission.Permission
|
import com.discord.api.permission.Permission
|
||||||
import com.discord.databinding.WidgetSearchSuggestionsItemHasBinding
|
import com.discord.databinding.WidgetSearchSuggestionsItemHasBinding
|
||||||
import com.discord.models.member.GuildMember
|
import com.discord.models.member.GuildMember
|
||||||
import com.discord.models.user.User
|
import com.discord.models.user.User
|
||||||
import com.discord.restapi.RequiredHeadersInterceptor
|
import com.discord.restapi.RequiredHeadersInterceptor
|
||||||
import com.discord.restapi.RequiredHeadersInterceptor.HeadersProvider
|
|
||||||
import com.discord.restapi.RestAPIBuilder
|
import com.discord.restapi.RestAPIBuilder
|
||||||
import com.discord.simpleast.core.parser.*
|
import com.discord.simpleast.core.parser.*
|
||||||
import com.discord.stores.StoreSearch
|
import com.discord.stores.*
|
||||||
import com.discord.stores.StoreSearchInput
|
|
||||||
import com.discord.stores.StoreStream
|
|
||||||
import com.discord.utilities.mg_recycler.MGRecyclerDataPayload
|
import com.discord.utilities.mg_recycler.MGRecyclerDataPayload
|
||||||
import com.discord.utilities.mg_recycler.SingleTypePayload
|
import com.discord.utilities.mg_recycler.SingleTypePayload
|
||||||
import com.discord.utilities.rest.RestAPI.AppHeadersProvider
|
import com.discord.utilities.rest.RestAPI.AppHeadersProvider
|
||||||
|
|
@ -34,10 +29,7 @@ import com.discord.utilities.search.network.`SearchFetcher$getRestObservable$3`
|
||||||
import com.discord.utilities.search.network.SearchQuery
|
import com.discord.utilities.search.network.SearchQuery
|
||||||
import com.discord.utilities.search.query.FilterType
|
import com.discord.utilities.search.query.FilterType
|
||||||
import com.discord.utilities.search.query.node.QueryNode
|
import com.discord.utilities.search.query.node.QueryNode
|
||||||
import com.discord.utilities.search.query.node.answer.ChannelNode
|
import com.discord.utilities.search.query.node.answer.*
|
||||||
import com.discord.utilities.search.query.node.answer.HasAnswerOption
|
|
||||||
import com.discord.utilities.search.query.node.answer.HasNode
|
|
||||||
import com.discord.utilities.search.query.node.answer.UserNode
|
|
||||||
import com.discord.utilities.search.query.node.content.ContentNode
|
import com.discord.utilities.search.query.node.content.ContentNode
|
||||||
import com.discord.utilities.search.query.node.filter.FilterNode
|
import com.discord.utilities.search.query.node.filter.FilterNode
|
||||||
import com.discord.utilities.search.query.parsing.QueryParser
|
import com.discord.utilities.search.query.parsing.QueryParser
|
||||||
|
|
@ -57,6 +49,7 @@ import moe.lava.awoocord.scout.api.SearchAPIInterface
|
||||||
import moe.lava.awoocord.scout.parsing.*
|
import moe.lava.awoocord.scout.parsing.*
|
||||||
import moe.lava.awoocord.scout.ui.*
|
import moe.lava.awoocord.scout.ui.*
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
|
import b.a.k.b as FormatUtils
|
||||||
|
|
||||||
@AliucordPlugin()
|
@AliucordPlugin()
|
||||||
@Suppress("unused", "unchecked_cast")
|
@Suppress("unused", "unchecked_cast")
|
||||||
|
|
@ -97,8 +90,7 @@ class Scout : Plugin() {
|
||||||
|
|
||||||
// Creates a new custom search API implementation, for the extra `min_id` param in search queries
|
// Creates a new custom search API implementation, for the extra `min_id` param in search queries
|
||||||
private fun buildSearchApi(context: Context): SearchAPIInterface {
|
private fun buildSearchApi(context: Context): SearchAPIInterface {
|
||||||
@Suppress("cast_never_succeeds")
|
val appHeadersProvider = AppHeadersProvider.INSTANCE
|
||||||
val appHeadersProvider = AppHeadersProvider.INSTANCE as HeadersProvider
|
|
||||||
val requiredHeadersInterceptor = RequiredHeadersInterceptor(appHeadersProvider)
|
val requiredHeadersInterceptor = RequiredHeadersInterceptor(appHeadersProvider)
|
||||||
val persistentCookieJar = PersistentCookieJar(SetCookieCache(), SharedPrefsCookiePersistor(context))
|
val persistentCookieJar = PersistentCookieJar(SetCookieCache(), SharedPrefsCookiePersistor(context))
|
||||||
val restAPIBuilder = RestAPIBuilder(BuildConfig.HOST_API, persistentCookieJar)
|
val restAPIBuilder = RestAPIBuilder(BuildConfig.HOST_API, persistentCookieJar)
|
||||||
|
|
@ -552,7 +544,7 @@ class Scout : Plugin() {
|
||||||
// Patch formatting utils to use our custom lowercase strings
|
// Patch formatting utils to use our custom lowercase strings
|
||||||
// This is called by FilterViewHolder.onConfigure, using the results from getAnswerText and getFilterText
|
// This is called by FilterViewHolder.onConfigure, using the results from getAnswerText and getFilterText
|
||||||
patcher.patch(
|
patcher.patch(
|
||||||
b.a.k.b::class.java.getDeclaredMethod("c",
|
FormatUtils::class.java.getDeclaredMethod("c",
|
||||||
Resources::class.java,
|
Resources::class.java,
|
||||||
Int::class.javaPrimitiveType!!,
|
Int::class.javaPrimitiveType!!,
|
||||||
Array::class.java,
|
Array::class.java,
|
||||||
|
|
@ -568,12 +560,7 @@ class Scout : Plugin() {
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
override?.let {
|
override?.let {
|
||||||
// Why invoke? Becuase I can't for the life of me get Function1 to cast properly
|
param.result = FormatUtils.g(it, objArr.copyOf(), param.args[3] as b.a.k.`b$b`)
|
||||||
param.result = b.a.k.b::class.java.getDeclaredMethod("g",
|
|
||||||
CharSequence::class.java,
|
|
||||||
Array::class.java,
|
|
||||||
Function1::class.java
|
|
||||||
).invoke(null, it, objArr.copyOf(), param.args[3])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
package moe.lava.awoocord.scout.parsing
|
package moe.lava.awoocord.scout.parsing
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import com.discord.simpleast.core.parser.ParseSpec
|
import com.discord.simpleast.core.parser.*
|
||||||
import com.discord.simpleast.core.parser.Parser
|
|
||||||
import com.discord.simpleast.core.parser.Rule
|
|
||||||
import com.discord.utilities.search.query.node.QueryNode
|
import com.discord.utilities.search.query.node.QueryNode
|
||||||
import java.util.regex.Matcher
|
import java.util.regex.Matcher
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
|
|
@ -13,15 +11,15 @@ internal class SimpleParserRule(
|
||||||
regex: Pattern,
|
regex: Pattern,
|
||||||
private val parseMethod: (
|
private val parseMethod: (
|
||||||
matcher: Matcher,
|
matcher: Matcher,
|
||||||
parser: Parser<Context, in QueryNode, Any>,
|
parser: Parser<Context, in QueryNode, Any?>,
|
||||||
obj: Any
|
obj: Any?
|
||||||
) -> ParseSpec<Context, Any>
|
) -> ParseSpec<Context, Any?>
|
||||||
) : ParserRule(regex) {
|
) : ParserRule(regex) {
|
||||||
override fun parse(
|
override fun parse(
|
||||||
matcher: Matcher?,
|
matcher: Matcher?,
|
||||||
parser: Parser<Context, in QueryNode, in Any>,
|
parser: Parser<Context, in QueryNode, in Any?>,
|
||||||
obj: Any
|
obj: Any?
|
||||||
): ParseSpec<Context, in Any> {
|
): ParseSpec<Context, in Any?> {
|
||||||
checkNotNull(matcher) { "matcher" }
|
checkNotNull(matcher) { "matcher" }
|
||||||
checkNotNull(parser) { "parser" }
|
checkNotNull(parser) { "parser" }
|
||||||
return parseMethod(matcher, parser, obj)
|
return parseMethod(matcher, parser, obj)
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,5 @@ aliucord {
|
||||||
* Initial release >w<
|
* Initial release >w<
|
||||||
""".trimIndent())
|
""".trimIndent())
|
||||||
|
|
||||||
excludeFromUpdaterJson.set(false)
|
deploy.set(true)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest package="moe.lava.awoocord.zinnia" />
|
|
||||||
|
|
@ -62,7 +62,6 @@ object ZinniaSettings {
|
||||||
var blockApcaThreshold by api.delegate(75.0)
|
var blockApcaThreshold by api.delegate(75.0)
|
||||||
var blockWcagThreshold by api.delegate(4.5)
|
var blockWcagThreshold by api.delegate(4.5)
|
||||||
|
|
||||||
@Suppress("MISSING_DEPENDENCY_CLASS", "MISSING_DEPENDENCY_SUPERCLASS")
|
|
||||||
class Page : SettingsPage() {
|
class Page : SettingsPage() {
|
||||||
private lateinit var manager: RadioManager
|
private lateinit var manager: RadioManager
|
||||||
private lateinit var mRoleDot: CheckedSetting
|
private lateinit var mRoleDot: CheckedSetting
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,24 @@
|
||||||
|
@file:Suppress("UnstableApiUsage")
|
||||||
|
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
gradlePluginPortal()
|
||||||
|
maven("https://maven.aliucord.com/releases")
|
||||||
|
maven("https://maven.aliucord.com/snapshots")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
maven("https://maven.aliucord.com/releases")
|
||||||
|
maven("https://maven.aliucord.com/snapshots")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rootProject.name = "Awoocord"
|
rootProject.name = "Awoocord"
|
||||||
|
|
||||||
val plugins = mapOf(
|
val plugins = mapOf(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue