From ca6fedb06a4f5ed4da28a0aefbbde88c5029c59a Mon Sep 17 00:00:00 2001 From: Tadeas Kriz Date: Fri, 12 Apr 2024 09:21:50 -0400 Subject: [PATCH] Backport Gradle Configuration Cache. --- .github/workflows/smoke-tests.yml | 81 ++++-- ....xml => Tests_Acceptance_Selected.run.xml} | 4 +- SKIE/settings.gradle.kts | 4 +- .../gradle-plugin-loader.gradle.kts | 110 -------- .../gradle-plugin-shim-api.gradle.kts} | 7 +- .../skie/plugin/shim/DistributionProvider.kt | 11 + .../shim/NativeCompilerDownloaderProvider.kt | 8 + .../skie/plugin/shim/ShimEntrypoint.kt | 7 + .../gradle-plugin-shim-impl.gradle.kts | 97 +++++++ .../kotlin-compiler-attribute-local | 0 .../plugin/shim/DistributionProviderImpl.kt | 12 + .../NativeCompilerDownloaderProviderImpl.kt | 11 + .../skie/plugin/shim/ShimEntrypointImpl.kt | 8 + .../plugin/gradle-plugin.gradle.kts | 169 +++++++----- .../touchlab/skie/plugin/SkieGradlePlugin.kt | 129 --------- .../coroutines/ConfigureMinOsVersionTask.kt | 94 ------- .../coroutines/ConfigureMinOsVersions.kt | 18 -- .../co/touchlab/skie/plugin/util/KonanHome.kt | 8 - .../skie/gradle/KotlinCompilerVersion.kt | 0 .../skie/gradle/KotlinToolingVersion.kt | 0 .../touchlab/skie/plugin/SkieGradlePlugin.kt} | 146 ++++++++-- .../skie/plugin/SkieInternalExtension.kt | 0 .../analytics/GradleAnalyticsManager.kt | 26 +- .../analytics/SkieUploadAnalyticsTask.kt | 0 .../environment/GradleEnvironmentAnalytics.kt | 11 +- .../skie/plugin/analytics/git/GitAnalytics.kt | 12 +- .../analytics/hardware/HardwareAnalytics.kt | 0 .../performance/GradlePerformanceAnalytics.kt | 0 .../analytics/project/ProjectAnalytics.kt | 8 +- .../CreateSkieConfigurationTask.kt | 12 +- .../configuration/Project.skieExtension.kt | 0 .../SkieAnalyticsConfiguration.kt | 0 .../configuration/SkieBuildConfiguration.kt | 0 .../configuration/SkieDebugConfiguration.kt | 0 .../plugin/configuration/SkieExtension.kt | 0 .../configuration/SkieFeatureConfiguration.kt | 0 .../SkieMigrationConfiguration.kt | 0 .../util/BooleanProperty.takeIf.kt | 0 .../util/GradleSkieConfiguration.kt | 0 .../coroutines/AddDependencyOnSkieRuntime.kt | 5 +- .../coroutines/ConfigureMinOsVersions.kt | 56 ++++ .../coroutines/IsCoroutinesInteropEnabled.kt | 0 .../DisableCachingForDefaultArguments.kt | 0 .../SkieCompilerPluginDependencyProvider.kt | 8 +- .../directory/SkieDirectoriesManager.kt | 0 .../fatframework/FatFrameworkConfigurator.kt | 0 .../plugin/subplugin/SkieSubPluginManager.kt | 0 .../skie/plugin/subplugin/SkieSubplugin.kt | 0 .../switflink/SwiftLinkingConfigurator.kt | 0 .../touchlab/skie/plugin/util/BaseSkieTask.kt | 0 .../touchlab/skie/plugin/util/DarwinTarget.kt | 0 .../co/touchlab/skie/plugin/util/KonanHome.kt | 9 + .../co/touchlab/skie/plugin/util/KotlinDsl.kt | 0 .../plugin/util/KotlinPluginExtensions.kt | 0 .../SkiePluginOptionToCompilerPluginOption.kt | 0 .../touchlab/skie/plugin/util/SkieTarget.kt | 0 .../co/touchlab/skie/plugin/util/StringMap.kt | 0 .../touchlab/skie/plugin/util/TargetTriple.kt | 0 .../skie/plugin/util/TaskDoOptimized.kt | 0 .../touchlab/skie/plugin/util/toPrettyJson.kt | 0 .../skie/plugin/SkieGradlePluginTest.kt | 0 .../src/main/kotlin-compiler-attribute-local | 2 +- .../buildsetup/plugins/DevAcceptanceTests.kt | 2 +- .../buildsetup/plugins/SkiePublishable.kt | 15 ++ common-gradle/gradle.properties | 6 + common-gradle/gradle/libs.versions.toml | 6 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../pure-compiler/framework/build.gradle.kts | 4 +- dev-support/settings.gradle.kts | 13 +- .../skie/ios/framework/build.gradle.kts | 4 +- .../skie/mac/framework/build.gradle.kts | 4 +- test-runner/build.gradle.kts | 70 +++++ test-runner/buildSrc/build.gradle.kts | 7 + .../skie/PublishSkieToTempMavenTask.kt | 40 +++ test-runner/gradle | 1 + test-runner/gradle.properties | 1 + test-runner/gradlew | 1 + test-runner/gradlew.bat | 1 + test-runner/settings.gradle.kts | 14 + .../skie/test/annotation/MatrixTest.kt | 13 + .../skie/test/annotation/filter/Exclude.kt | 17 ++ .../skie/test/annotation/filter/Filter.kt | 7 + .../annotation/filter/FilterMatrixWith.kt | 10 + .../skie/test/annotation/filter/Include.kt | 17 ++ .../test/annotation/filter/MatrixFilter.kt | 8 + .../filter/OnlyConfigurationCache.kt | 9 + .../skie/test/annotation/filter/OnlyDebug.kt | 8 + .../test/annotation/filter/OnlyDynamic.kt | 8 + .../skie/test/annotation/filter/OnlyFor.kt | 18 ++ .../skie/test/annotation/filter/OnlyIos.kt | 8 + .../skie/test/annotation/filter/OnlyMacos.kt | 8 + .../test/annotation/filter/OnlyRelease.kt | 8 + .../skie/test/annotation/filter/OnlyStatic.kt | 8 + .../skie/test/annotation/filter/Smoke.kt | 5 + .../skie/test/annotation/filter/SmokeOnly.kt | 6 + .../test/annotation/type/AcceptanceTests.kt | 7 + .../skie/test/annotation/type/DemoTests.kt | 7 + .../annotation/type/ExternalLibrariesTests.kt | 7 + .../skie/test/annotation/type/GradleTests.kt | 7 + .../test/annotation/type/PerformanceTests.kt | 7 + .../skie/test/annotation/type/SkieTestType.kt | 10 + .../test/annotation/type/TypeMappingTests.kt | 7 + .../skie/test/base/BaseGradleTests.kt | 156 +++++++++++ .../OnlyConfigurationCacheMatrixFilter.kt | 15 ++ .../skie/test/filter/OnlyForMatrixFilter.kt | 38 +++ .../skie/test/runner/BuildConfiguration.kt | 6 + .../touchlab/skie/test/runner/MatrixFilter.kt | 13 + .../skie/test/runner/SkieMatrixExtension.kt | 19 ++ .../skie/test/runner/SkieTestMatrix.kt | 41 +++ .../skie/test/runner/SkieTestMatrixContext.kt | 25 ++ .../skie/test/runner/SkieTestRunner.kt | 51 ++++ .../runner/SkieTestRunnerConfiguration.kt | 108 ++++++++ .../co/touchlab/skie/test/runner/TestLevel.kt | 6 + .../co/touchlab/skie/test/runner/TestType.kt | 10 + .../runner/condition/SmokeTestCondition.kt | 27 ++ .../runner/condition/TestTypeCondition.kt | 20 ++ ...DarwinTargetsAllFrameworkArtifactsTests.kt | 53 ++++ ...rwinTargetsSingleFrameworkArtifactTests.kt | 53 ++++ ...ArtifactDsl_Framework_SingleTargetTests.kt | 49 ++++ ...niversalFramework_AllDarwinTargetsTests.kt | 71 +++++ ...sl_UniversalFramework_SingleTargetTests.kt | 53 ++++ ...ctDsl_XCFramework_AllDarwinTargetsTests.kt | 62 +++++ ...tifactDsl_XCFramework_SingleTargetTests.kt | 64 +++++ ...naryDsl_Framework_AllDarwinPresetsTests.kt | 39 +++ ...inBinaryDsl_Framework_SinglePresetTests.kt | 40 +++ ...inBinaryDsl_Framework_SingleTargetTests.kt | 40 +++ .../basic/NoArtifact_AllDarwinTargetsTests.kt | 23 ++ .../basic/NoArtifact_SingleTargetTests.kt | 27 ++ .../GradleConfigurationCacheTests.kt | 129 +++++++++ .../touchlab/skie/test/template/Template.kt | 6 + .../test/template/TemplateBuilderScope.kt | 7 + .../skie/test/template/TemplateFile.kt | 14 + .../touchlab/skie/test/template/Templates.kt | 10 + .../skie/test/template/buildTemplate.kt | 38 +++ .../skie/test/trait/TestUtilsTrait.kt | 24 ++ .../test/trait/gradle/BuildGradleBuilder.kt | 255 ++++++++++++++++++ .../skie/test/trait/gradle/BuildGradleFile.kt | 14 + .../gradle/GradleBuildFileBuilderTrait.kt | 11 + .../test/util/BuildResult.shouldBeSuccess.kt | 9 + .../test/util/BuildTask.shouldBeSuccess.kt | 11 + .../touchlab/skie/test/util/CommandResult.kt | 3 + .../touchlab/skie/test/util/GradleVersion.kt | 7 + .../test/util/IsTestMethodOrClassAnnotated.kt | 9 + .../touchlab/skie/test/util/KotlinTarget.kt | 123 +++++++++ .../skie/test/util/KotlinTargetOrPreset.kt | 33 +++ .../touchlab/skie/test/util/KotlinVersion.kt | 7 + .../test/util/KotlinVersion.needsOldLinker.kt | 4 + .../co/touchlab/skie/test/util/LinkMode.kt | 9 + .../skie/test/util/RawKotlinTarget.kt | 11 + .../skie/test/util/SkieBinaryTarget.kt | 11 + .../touchlab/skie/test/util/String.execute.kt | 43 +++ .../skie/test/util/StringBuilderScope.kt | 13 + .../co/touchlab/skie/test/util/buildString.kt | 17 ++ .../test/resources/junit-platform.properties | 7 + .../templates/basic/BasicSkieFeatures.kt | 25 ++ .../test/resources/templates/basic/main.swift | 22 ++ 156 files changed, 2951 insertions(+), 504 deletions(-) rename SKIE/.run/{Latest_Tests_Acceptance_Selected.run.xml => Tests_Acceptance_Selected.run.xml} (96%) delete mode 100644 SKIE/skie-gradle/plugin-loader/gradle-plugin-loader.gradle.kts rename SKIE/skie-gradle/{plugin-api/gradle-plugin-api.gradle.kts => plugin-shim-api/gradle-plugin-shim-api.gradle.kts} (63%) create mode 100644 SKIE/skie-gradle/plugin-shim-api/src/common/kotlin/co/touchlab/skie/plugin/shim/DistributionProvider.kt create mode 100644 SKIE/skie-gradle/plugin-shim-api/src/common/kotlin/co/touchlab/skie/plugin/shim/NativeCompilerDownloaderProvider.kt create mode 100644 SKIE/skie-gradle/plugin-shim-api/src/common/kotlin/co/touchlab/skie/plugin/shim/ShimEntrypoint.kt create mode 100644 SKIE/skie-gradle/plugin-shim-impl/gradle-plugin-shim-impl.gradle.kts rename SKIE/skie-gradle/{plugin => plugin-shim-impl}/src/kgp_common/gradle_common/kotlin-compiler-attribute-local (100%) create mode 100644 SKIE/skie-gradle/plugin-shim-impl/src/kgp_common/gradle_common/kotlin/co/touchlab/skie/plugin/shim/DistributionProviderImpl.kt create mode 100644 SKIE/skie-gradle/plugin-shim-impl/src/kgp_common/gradle_common/kotlin/co/touchlab/skie/plugin/shim/NativeCompilerDownloaderProviderImpl.kt create mode 100644 SKIE/skie-gradle/plugin-shim-impl/src/kgp_common/gradle_common/kotlin/co/touchlab/skie/plugin/shim/ShimEntrypointImpl.kt delete mode 100644 SKIE/skie-gradle/plugin/src/kgp_common/gradle_common/kotlin/co/touchlab/skie/plugin/SkieGradlePlugin.kt delete mode 100644 SKIE/skie-gradle/plugin/src/kgp_common/gradle_common/kotlin/co/touchlab/skie/plugin/coroutines/ConfigureMinOsVersionTask.kt delete mode 100644 SKIE/skie-gradle/plugin/src/kgp_common/gradle_common/kotlin/co/touchlab/skie/plugin/coroutines/ConfigureMinOsVersions.kt delete mode 100644 SKIE/skie-gradle/plugin/src/kgp_common/gradle_common/kotlin/co/touchlab/skie/plugin/util/KonanHome.kt rename SKIE/skie-gradle/{plugin-loader => plugin}/src/main/kotlin-compiler-attribute/co/touchlab/skie/gradle/KotlinCompilerVersion.kt (100%) rename SKIE/skie-gradle/{plugin-loader => plugin}/src/main/kotlin-compiler-attribute/co/touchlab/skie/gradle/KotlinToolingVersion.kt (100%) rename SKIE/skie-gradle/{plugin-loader/src/main/kotlin/co/touchlab/skie/plugin/SkieLoaderPlugin.kt => plugin/src/main/kotlin/co/touchlab/skie/plugin/SkieGradlePlugin.kt} (58%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/SkieInternalExtension.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/analytics/GradleAnalyticsManager.kt (74%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/analytics/SkieUploadAnalyticsTask.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/analytics/environment/GradleEnvironmentAnalytics.kt (79%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/analytics/git/GitAnalytics.kt (81%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/analytics/hardware/HardwareAnalytics.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/analytics/performance/GradlePerformanceAnalytics.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/analytics/project/ProjectAnalytics.kt (70%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/configuration/CreateSkieConfigurationTask.kt (76%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/configuration/Project.skieExtension.kt (100%) rename SKIE/skie-gradle/{plugin-api/src/common => plugin/src/main}/kotlin/co/touchlab/skie/plugin/configuration/SkieAnalyticsConfiguration.kt (100%) rename SKIE/skie-gradle/{plugin-api/src/common => plugin/src/main}/kotlin/co/touchlab/skie/plugin/configuration/SkieBuildConfiguration.kt (100%) rename SKIE/skie-gradle/{plugin-api/src/common => plugin/src/main}/kotlin/co/touchlab/skie/plugin/configuration/SkieDebugConfiguration.kt (100%) rename SKIE/skie-gradle/{plugin-api/src/common => plugin/src/main}/kotlin/co/touchlab/skie/plugin/configuration/SkieExtension.kt (100%) rename SKIE/skie-gradle/{plugin-api/src/common => plugin/src/main}/kotlin/co/touchlab/skie/plugin/configuration/SkieFeatureConfiguration.kt (100%) rename SKIE/skie-gradle/{plugin-api/src/common => plugin/src/main}/kotlin/co/touchlab/skie/plugin/configuration/SkieMigrationConfiguration.kt (100%) rename SKIE/skie-gradle/{plugin-api/src/common => plugin/src/main}/kotlin/co/touchlab/skie/plugin/configuration/util/BooleanProperty.takeIf.kt (100%) rename SKIE/skie-gradle/{plugin-api/src/common => plugin/src/main}/kotlin/co/touchlab/skie/plugin/configuration/util/GradleSkieConfiguration.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/coroutines/AddDependencyOnSkieRuntime.kt (93%) create mode 100644 SKIE/skie-gradle/plugin/src/main/kotlin/co/touchlab/skie/plugin/coroutines/ConfigureMinOsVersions.kt rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/coroutines/IsCoroutinesInteropEnabled.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/defaultarguments/DisableCachingForDefaultArguments.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/dependencies/SkieCompilerPluginDependencyProvider.kt (78%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/directory/SkieDirectoriesManager.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/fatframework/FatFrameworkConfigurator.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/subplugin/SkieSubPluginManager.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/subplugin/SkieSubplugin.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/switflink/SwiftLinkingConfigurator.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/util/BaseSkieTask.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/util/DarwinTarget.kt (100%) create mode 100644 SKIE/skie-gradle/plugin/src/main/kotlin/co/touchlab/skie/plugin/util/KonanHome.kt rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/util/KotlinDsl.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/util/KotlinPluginExtensions.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/util/SkiePluginOptionToCompilerPluginOption.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/util/SkieTarget.kt (100%) rename SKIE/skie-gradle/{plugin-loader => plugin}/src/main/kotlin/co/touchlab/skie/plugin/util/StringMap.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/util/TargetTriple.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/util/TaskDoOptimized.kt (100%) rename SKIE/skie-gradle/plugin/src/{kgp_common/gradle_common => main}/kotlin/co/touchlab/skie/plugin/util/toPrettyJson.kt (100%) rename SKIE/skie-gradle/{plugin-loader => plugin}/src/test/kotlin/co/touchlab/skie/plugin/SkieGradlePluginTest.kt (100%) create mode 100644 test-runner/build.gradle.kts create mode 100644 test-runner/buildSrc/build.gradle.kts create mode 100644 test-runner/buildSrc/src/main/kotlin/co/touchlab/skie/PublishSkieToTempMavenTask.kt create mode 120000 test-runner/gradle create mode 120000 test-runner/gradle.properties create mode 120000 test-runner/gradlew create mode 120000 test-runner/gradlew.bat create mode 100644 test-runner/settings.gradle.kts create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/MatrixTest.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/Exclude.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/Filter.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/FilterMatrixWith.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/Include.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/MatrixFilter.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyConfigurationCache.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyDebug.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyDynamic.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyFor.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyIos.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyMacos.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyRelease.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyStatic.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/Smoke.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/SmokeOnly.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/AcceptanceTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/DemoTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/ExternalLibrariesTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/GradleTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/PerformanceTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/SkieTestType.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/TypeMappingTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/base/BaseGradleTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/filter/OnlyConfigurationCacheMatrixFilter.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/filter/OnlyForMatrixFilter.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/BuildConfiguration.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/MatrixFilter.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/SkieMatrixExtension.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/SkieTestMatrix.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/SkieTestMatrixContext.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/SkieTestRunner.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/SkieTestRunnerConfiguration.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/TestLevel.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/TestType.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/condition/SmokeTestCondition.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/condition/TestTypeCondition.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinArtifactDsl_Framework_AllDarwinTargetsAllFrameworkArtifactsTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinArtifactDsl_Framework_AllDarwinTargetsSingleFrameworkArtifactTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinArtifactDsl_Framework_SingleTargetTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinArtifactDsl_UniversalFramework_AllDarwinTargetsTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinArtifactDsl_UniversalFramework_SingleTargetTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinArtifactDsl_XCFramework_AllDarwinTargetsTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinArtifactDsl_XCFramework_SingleTargetTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinBinaryDsl_Framework_AllDarwinPresetsTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinBinaryDsl_Framework_SinglePresetTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinBinaryDsl_Framework_SingleTargetTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/NoArtifact_AllDarwinTargetsTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/NoArtifact_SingleTargetTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/configurationcache/GradleConfigurationCacheTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/template/Template.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/template/TemplateBuilderScope.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/template/TemplateFile.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/template/Templates.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/template/buildTemplate.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/trait/TestUtilsTrait.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/trait/gradle/BuildGradleBuilder.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/trait/gradle/BuildGradleFile.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/trait/gradle/GradleBuildFileBuilderTrait.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/BuildResult.shouldBeSuccess.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/BuildTask.shouldBeSuccess.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/CommandResult.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/GradleVersion.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/IsTestMethodOrClassAnnotated.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/KotlinTarget.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/KotlinTargetOrPreset.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/KotlinVersion.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/KotlinVersion.needsOldLinker.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/LinkMode.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/RawKotlinTarget.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/SkieBinaryTarget.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/String.execute.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/StringBuilderScope.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/buildString.kt create mode 100644 test-runner/src/test/resources/junit-platform.properties create mode 100644 test-runner/src/test/resources/templates/basic/BasicSkieFeatures.kt create mode 100644 test-runner/src/test/resources/templates/basic/main.swift diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 6f657bfe4..465c38162 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -21,12 +21,12 @@ on: configuration: type: choice options: - - release - debug + - release required: true - default: release + default: debug description: - 'The configuration to use for the tests. "release" will produce release builds, "debug" will produce debug builds (and skip type mapping tests for now).' + 'The configuration to use for the tests. "release" will produce release builds, "debug" will produce debug builds (type mapping tests currently always use release).' target: type: choice options: @@ -50,6 +50,7 @@ concurrency: jobs: acceptance-tests: name: Acceptance Tests + needs: [gradle-tests] runs-on: self-hosted steps: - name: Checkout Repo @@ -67,18 +68,18 @@ jobs: env: KOTLIN_LINK_MODE: ${{ inputs.linkage }} KOTLIN_BUILD_CONFIGURATION: ${{ inputs.configuration }} - - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 - if: ${{ failure() || success() }} - with: - check_name: "Smoke Test Reports - Functional Tests" - report_paths: 'SKIE/acceptance-tests/build/test-results/functional__*/TEST-*.xml' - require_tests: true + # Log size can be too large which causes significant performance issues + # - name: Publish Test Report + # uses: mikepenz/action-junit-report@v3 + # if: ${{ failure() || success() }} + # with: + # check_name: "Smoke Test Reports - Functional Tests" + # report_paths: 'SKIE/acceptance-tests/build/test-results/functional__*/TEST-*.xml' + # require_tests: true type-mapping-tests: name: Type Mapping Tests - needs: [acceptance-tests] - runs-on: self-hosted + runs-on: macos-14 steps: - name: Checkout Repo uses: actions/checkout@v3 @@ -90,7 +91,6 @@ jobs: - name: Run Type Mapping Tests uses: gradle/gradle-build-action@v2.4.2 id: run-tests - if: ${{ inputs.configuration != 'debug' }} with: arguments: ':acceptance-tests:type-mapping__kgp_latestTest' build-root-directory: SKIE @@ -98,17 +98,18 @@ jobs: KOTLIN_LINK_MODE: ${{ inputs.linkage }} KOTLIN_TARGET: ${{ inputs.target }} KOTLIN_BUILD_CONFIGURATION: ${{ inputs.configuration }} - - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 - if: ${{ (failure() || success()) && steps.run-tests.outcome != 'skipped' }} - with: - check_name: "Smoke Test Reports - Type Mapping Tests" - report_paths: 'SKIE/acceptance-tests/build/test-results/type-mapping__*/TEST-*.xml' - require_tests: true + # Log size can be too large which causes significant performance issues + # - name: Publish Test Report + # uses: mikepenz/action-junit-report@v3 + # if: ${{ (failure() || success()) && steps.run-tests.outcome != 'skipped' }} + # with: + # check_name: "Smoke Test Reports - Type Mapping Tests" + # report_paths: 'SKIE/acceptance-tests/build/test-results/type-mapping__*/TEST-*.xml' + # require_tests: true external-libraries-tests: name: External Libraries Tests - needs: [type-mapping-tests] + needs: [acceptance-tests, gradle-tests] runs-on: self-hosted steps: - name: Checkout Repo @@ -126,10 +127,42 @@ jobs: env: KOTLIN_LINK_MODE: ${{ inputs.linkage }} KOTLIN_BUILD_CONFIGURATION: ${{ inputs.configuration }} + # Log size can be too large which causes significant performance issues + # - name: Publish Test Report + # uses: mikepenz/action-junit-report@v3 + # if: ${{ failure() || success() }} + # with: + # check_name: "Smoke Test Reports - External Libraries Tests" + # report_paths: 'SKIE/acceptance-tests/build/test-results/libraries__*/TEST-*.xml' + # require_tests: true + + gradle-tests: + name: Gradle Tests + runs-on: self-hosted + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + submodules: true + token: ${{ secrets.ACCEPTANCE_TESTS_TOKEN }} + - name: Prepare Worker + uses: ./.github/actions/prepare-worker + - name: Run Gradle Tests + uses: gradle/gradle-build-action@v2.4.2 + id: run-tests + with: + arguments: >- + :test + -PtestLevel=smoke + -PtestType=gradle + "-Pmatrix.targets=${{ inputs.target || 'macosArm64' }}" + "-Pmatrix.configurations=${{ inputs.configuration || 'debug' }}" + "-Pmatrix.linkModes=${{ inputs.linkage || 'static' }}" + build-root-directory: test-runner - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 + uses: mikepenz/action-junit-report@v4 if: ${{ failure() || success() }} with: - check_name: "Smoke Test Reports - External Libraries Tests" - report_paths: 'SKIE/acceptance-tests/build/test-results/libraries__*/TEST-*.xml' + check_name: "Smoke Test Reports - Gradle Tests" + report_paths: 'test-runner/build/test-results/test/TEST-*.xml' require_tests: true diff --git a/SKIE/.run/Latest_Tests_Acceptance_Selected.run.xml b/SKIE/.run/Tests_Acceptance_Selected.run.xml similarity index 96% rename from SKIE/.run/Latest_Tests_Acceptance_Selected.run.xml rename to SKIE/.run/Tests_Acceptance_Selected.run.xml index 6fb27d8bf..9bfaaa1af 100644 --- a/SKIE/.run/Latest_Tests_Acceptance_Selected.run.xml +++ b/SKIE/.run/Tests_Acceptance_Selected.run.xml @@ -3,7 +3,7 @@