forked from square/dagger
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Gradle project to run functional tests
Only packages with Java sources are added for now. RELNOTES=N/A PiperOrigin-RevId: 720564371
- Loading branch information
1 parent
fb06a5d
commit ae67d23
Showing
5 changed files
with
142 additions
and
29 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
buildSrc/src/main/kotlin/dagger/gradle/build/JarDependencies.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (C) 2025 The Dagger Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dagger.gradle.build | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.file.RegularFile | ||
|
||
fun Project.findBootstrapCompilerJar(): RegularFile = | ||
rootProject.layout.projectDirectory | ||
.dir("java/dagger/internal/codegen/bootstrap") | ||
.file("bootstrap_compiler_deploy.jar") | ||
|
||
fun Project.findXProcessingJar(): RegularFile = | ||
rootProject.layout.projectDirectory | ||
.dir("java/dagger/internal/codegen/xprocessing") | ||
.file("xprocessing.jar") |
82 changes: 82 additions & 0 deletions
82
gradle-projects/dagger-compiler-functional-tests/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import dagger.gradle.build.daggerSources | ||
import dagger.gradle.build.findXProcessingJar | ||
|
||
plugins { alias(libs.plugins.dagger.kotlinJvm) } | ||
|
||
daggerSources { | ||
// TODO(danysantiago): Add packages that test Kotlin sources | ||
test.setPackages( | ||
listOf( | ||
"javatests/dagger/functional/assisted", | ||
"javatests/dagger/functional/assisted/subpackage", | ||
"javatests/dagger/functional/basic", | ||
"javatests/dagger/functional/basic/subpackage", | ||
"javatests/dagger/functional/binds", | ||
"javatests/dagger/functional/binds/subpackage", | ||
"javatests/dagger/functional/builder", | ||
"javatests/dagger/functional/builderbinds", | ||
"javatests/dagger/functional/componentdependency", | ||
"javatests/dagger/functional/componentdependency/subpackage", | ||
"javatests/dagger/functional/cycle", | ||
"javatests/dagger/functional/factory", | ||
"javatests/dagger/functional/generated", | ||
"javatests/dagger/functional/generictypes", | ||
"javatests/dagger/functional/generictypes/subpackage", | ||
"javatests/dagger/functional/guava", | ||
"javatests/dagger/functional/guava/a", | ||
"javatests/dagger/functional/jakarta", | ||
"javatests/dagger/functional/jdk8", | ||
"javatests/dagger/functional/jdk8/a", | ||
"javatests/dagger/functional/membersinject", | ||
"javatests/dagger/functional/membersinject/subpackage", | ||
"javatests/dagger/functional/membersinject/subpackage/a", | ||
"javatests/dagger/functional/membersinject/subpackage/b", | ||
"javatests/dagger/functional/modules", | ||
"javatests/dagger/functional/modules/subpackage", | ||
"javatests/dagger/functional/multibindings", | ||
"javatests/dagger/functional/multibindings/subpackage", | ||
"javatests/dagger/functional/multipackage", | ||
"javatests/dagger/functional/multipackage/a", | ||
"javatests/dagger/functional/multipackage/b", | ||
"javatests/dagger/functional/multipackage/c", | ||
"javatests/dagger/functional/multipackage/d", | ||
"javatests/dagger/functional/multipackage/foo", | ||
"javatests/dagger/functional/multipackage/grandsub", | ||
"javatests/dagger/functional/multipackage/moduleconstructor", | ||
"javatests/dagger/functional/multipackage/primitives", | ||
"javatests/dagger/functional/multipackage/sub", | ||
"javatests/dagger/functional/names", | ||
"javatests/dagger/functional/nullables", | ||
"javatests/dagger/functional/rawtypes", | ||
"javatests/dagger/functional/reusable", | ||
"javatests/dagger/functional/scope", | ||
"javatests/dagger/functional/staticproviders", | ||
"javatests/dagger/functional/subcomponent", | ||
"javatests/dagger/functional/subcomponent/hiding", | ||
"javatests/dagger/functional/subcomponent/hiding/a", | ||
"javatests/dagger/functional/subcomponent/hiding/b", | ||
"javatests/dagger/functional/subcomponent/module", | ||
"javatests/dagger/functional/subcomponent/multibindings", | ||
"javatests/dagger/functional/subcomponent/pruning", | ||
"javatests/dagger/functional/subcomponent/repeat", | ||
) | ||
) | ||
} | ||
|
||
dependencies { | ||
testImplementation(project(":dagger")) | ||
testAnnotationProcessor(project(":dagger-compiler")) | ||
testAnnotationProcessor(project(":dagger-spi")) | ||
// Functional tests rely on the non-shaded version of the compiler, so we need to bring | ||
// those compile only dependencies. | ||
testAnnotationProcessor(libs.auto.common) | ||
testAnnotationProcessor(files(project.findXProcessingJar())) | ||
|
||
testImplementation(libs.junit) | ||
testImplementation(libs.truth) | ||
testImplementation(libs.auto.factory.annotations) | ||
testAnnotationProcessor(libs.auto.factory.compiler) | ||
testImplementation(libs.auto.value.annotations) | ||
testAnnotationProcessor(libs.auto.value.compiler) | ||
testImplementation(libs.kotlin.stdlib) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,33 @@ | ||
pluginManagement { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
repositories { | ||
google() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
dependencyResolutionManagement { | ||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
rootProject.name = "dagger-parent" | ||
|
||
fun includeProject(name: String, path: String) { | ||
include(name) | ||
project(name).projectDir = File(path) | ||
include(name) | ||
project(name).projectDir = File(path) | ||
} | ||
|
||
includeProject(":dagger", "gradle-projects/dagger-runtime") | ||
|
||
includeProject(":dagger-spi", "gradle-projects/dagger-spi") | ||
|
||
includeProject(":dagger-compiler", "gradle-projects/dagger-compiler") | ||
|
||
includeProject( | ||
":dagger-compiler-functional-tests", | ||
"gradle-projects/dagger-compiler-functional-tests", | ||
) |