This commit is contained in:
@@ -3,11 +3,11 @@ group = "app.twitter"
|
||||
patches {
|
||||
about {
|
||||
name = "X Patches"
|
||||
description = "Local patches for X (Twitter)"
|
||||
source = "local"
|
||||
author = "local"
|
||||
contact = "N/A"
|
||||
website = "N/A"
|
||||
description = "Patches for X (Twitter)"
|
||||
source = "https://git.krtss.de/StanPonomarev/twitter-patch"
|
||||
author = "Stan Ponomarev"
|
||||
contact = "contact@krtss.de"
|
||||
website = "https://git.krtss.de/StanPonomarev/twitter-patch"
|
||||
license = "GPLv3"
|
||||
}
|
||||
}
|
||||
@@ -22,9 +22,21 @@ kotlin {
|
||||
// generatePatchesList task but never bundled into the APK.
|
||||
val patchListGeneratorClasspath = configurations.create("patchListGeneratorClasspath")
|
||||
|
||||
val integrationTestSourceSet = sourceSets.create("integrationTest") {
|
||||
compileClasspath += sourceSets.main.get().output
|
||||
runtimeClasspath += sourceSets.main.get().output
|
||||
}
|
||||
|
||||
configurations[integrationTestSourceSet.implementationConfigurationName]
|
||||
.extendsFrom(configurations.testImplementation.get())
|
||||
configurations[integrationTestSourceSet.runtimeOnlyConfigurationName]
|
||||
.extendsFrom(configurations.testRuntimeOnly.get())
|
||||
|
||||
dependencies {
|
||||
compileOnly(libs.gson)
|
||||
patchListGeneratorClasspath(libs.gson)
|
||||
add(integrationTestSourceSet.implementationConfigurationName, kotlin("test-junit"))
|
||||
add(integrationTestSourceSet.implementationConfigurationName, libs.gson)
|
||||
}
|
||||
|
||||
tasks {
|
||||
@@ -42,3 +54,31 @@ tasks {
|
||||
dependsOn("generatePatchesList")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Test>("integrationTest") {
|
||||
group = "verification"
|
||||
description = "Downloads Morphe Desktop and applies the patch bundle to twitter.apkm."
|
||||
|
||||
dependsOn("buildAndroid")
|
||||
|
||||
testClassesDirs = integrationTestSourceSet.output.classesDirs
|
||||
classpath = integrationTestSourceSet.runtimeClasspath
|
||||
|
||||
val inputApkm = rootProject.layout.projectDirectory.file("twitter.apkm")
|
||||
val patchBundle = layout.buildDirectory.file("libs/${project.name}-${project.version}.mpp")
|
||||
val morpheCache = layout.buildDirectory.dir("verification/tools")
|
||||
|
||||
inputs.file(inputApkm)
|
||||
inputs.file(patchBundle)
|
||||
|
||||
systemProperty("integrationTest.inputApkm", inputApkm.asFile.absolutePath)
|
||||
systemProperty("integrationTest.patchBundle", patchBundle.get().asFile.absolutePath)
|
||||
systemProperty("integrationTest.morpheCache", morpheCache.get().asFile.absolutePath)
|
||||
systemProperty(
|
||||
"integrationTest.javaExecutable",
|
||||
javaToolchains.launcherFor {
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
}.get().executablePath.asFile.absolutePath
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user