mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
tests: fix path related test failures
This commit is contained in:
+3
-3
@@ -17,11 +17,11 @@
|
||||
|
||||
package com.itsaky.androidide.app.configuration
|
||||
|
||||
import com.android.SdkConstants.ABI_ARM64_V8A
|
||||
import com.android.SdkConstants.ABI_ARMEABI_V7A
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import com.itsaky.androidide.BuildConfig.ABI_ARM64_V8A
|
||||
import com.itsaky.androidide.BuildConfig.ABI_ARMEABI_V7A
|
||||
import com.itsaky.androidide.BuildConfig.ABI_X86_64
|
||||
import org.junit.Test
|
||||
import com.android.SdkConstants.ABI_INTEL_ATOM64 as ABI_X86_64
|
||||
|
||||
/**
|
||||
* @author Akash Yadav
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.gradle.testkit.runner.internal.PluginUnderTestMetadataReading
|
||||
import java.io.File
|
||||
import java.io.FileNotFoundException
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.Paths
|
||||
import kotlin.io.path.pathString
|
||||
|
||||
internal fun buildProject(
|
||||
@@ -36,7 +37,7 @@ internal fun buildProject(
|
||||
): BuildResult {
|
||||
val projectRoot = openProject(agpVersion, useApplyPluginGroovySyntax, *plugins)
|
||||
val initScript = FileProvider.testHomeDir().resolve(".androidide/init/androidide.init.gradle")
|
||||
val mavenLocal = FileProvider.projectRoot().resolve("gradle-plugin/build/maven-local/repos.txt").toFile()
|
||||
val mavenLocal = Paths.get("build/maven-local/repos.txt").toFile()
|
||||
|
||||
if (!(mavenLocal.exists() && mavenLocal.isFile)) {
|
||||
throw FileNotFoundException("repos.txt file not found")
|
||||
@@ -103,8 +104,7 @@ internal fun openProject(
|
||||
useApplyPluginGroovySyntax: Boolean = false,
|
||||
vararg plugins: String
|
||||
): Path {
|
||||
val projectRoot = FileProvider.projectRoot()
|
||||
.resolve("gradle-plugin/src/test/resources/sample-project")
|
||||
val projectRoot = Paths.get("src/test/resources/sample-project")
|
||||
|
||||
run {
|
||||
projectRoot.resolve("build.gradle.kts").toFile()
|
||||
|
||||
+3
-3
@@ -33,9 +33,9 @@ class TestRecipeExecutor : RecipeExecutor {
|
||||
// order of the element matters!
|
||||
private val modulesWithAssets by lazy {
|
||||
arrayOf(
|
||||
"templates-api",
|
||||
"templates-impl",
|
||||
"app"
|
||||
"utilities/templates-api",
|
||||
"utilities/templates-impl",
|
||||
"core/app"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class CompilerTest {
|
||||
@Test
|
||||
fun `test simple compilatation`() {
|
||||
val input =
|
||||
FileProvider.projectRoot().resolve("app/src/main/res/layout/activity_editor.xml").toFile()
|
||||
FileProvider.projectRoot().resolve("core/app/src/main/res/layout/activity_editor.xml").toFile()
|
||||
val output = Paths.get("./build").absolute().normalize().toFile()
|
||||
println(input)
|
||||
println(output)
|
||||
|
||||
Reference in New Issue
Block a user