Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Remove a bunch of other workarounds and warnings #5090

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions build-logic/src/main/kotlin/Node.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,4 @@ fun Project.configureNode() {
lockFileDirectory = projectDir.resolve("kotlin-js-store-${project.getKotlinPluginVersion().substringBeforeLast(".")}")
}
}

// See https://youtrack.jetbrains.com/issue/KT-49774/KJS-Gradle-Errors-during-NPM-dependencies-resolution-in-parallel-build-lead-to-unfriendly-error-messages-like-Projects-must-be#focus=Comments-27-6271456.0-0
rootProject.plugins.withType(NodeJsRootPlugin::class.java) {
project.extensions.getByType(NodeJsRootExtension::class.java).nodeVersion = "16.17.0"
}
}
7 changes: 0 additions & 7 deletions build-logic/src/main/kotlin/Publishing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,6 @@ private fun Project.setDefaultPomFields(mavenPublication: MavenPublication) {

private fun Project.createJavaSourcesTask(): TaskProvider<Jar> {
return tasks.register("javaSourcesJar", Jar::class.java) {
/**
* Add a dependency on the compileKotlin task to make sure the generated sources like
* antlr or SQLDelight get included
* See also https://youtrack.jetbrains.com/issue/KT-47936
*/
dependsOn("compileKotlin")

archiveClassifier.set("sources")
val sourceSets = project.extensions.getByType(JavaPluginExtension::class.java).sourceSets
from(sourceSets.getByName("main").allSource)
Expand Down
6 changes: 4 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import JapiCmp.configureJapiCmp
import java.util.Locale

plugins {
id("apollo.library") apply false
Expand Down Expand Up @@ -107,7 +108,7 @@ tasks.named("dokkaHtmlMultiModule").configure {
tasks.named("dependencyUpdates").configure {
(this as com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask)
rejectVersionIf {
listOf("alpha", "beta", "rc").any { candidate.version.toLowerCase().contains(it) }
listOf("alpha", "beta", "rc").any { candidate.version.lowercase().contains(it) }
}
}

Expand Down Expand Up @@ -147,8 +148,9 @@ configure<kotlinx.validation.ApiValidationExtension> {
}

tasks.register("rmbuild") {
val root = file(".")
doLast {
file(".").walk().onEnter {
root.walk().onEnter {
if (it.isDirectory && it.name == "build") {
println("deleting: $it")
it.deleteRecursively()
Expand Down
6 changes: 0 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,3 @@ org.gradle.caching=true
# org.gradle.configuration-cache=true

org.gradle.parallel=true

# See https://kotlinlang.org/docs/whatsnew-eap.html#preview-of-gradle-composite-builds-support-in-kotlin-multiplatform
kotlin.mpp.import.enableKgpDependencyResolution=true

# See https://youtrack.jetbrains.com/issue/KT-55995/Add-ability-to-perform-precise-compilation-task-outputs-backup
kotlin.compiler.preciseCompilationResultsBackup=true
6 changes: 3 additions & 3 deletions gradle/libraries.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ truth = "1.1.3"
[libraries]
android-plugin = { group = "com.android.tools.build", name = "gradle", version.ref = "android-plugin" }
android-plugin-min = { group = "com.android.tools.build", name = "gradle", version.ref = "android-plugin-min" }
android-support-annotations = { group = "com.android.support", name = "support-annotations", version = "28.0.0" }
android-test-runner = { group = "com.android.support.test", name = "runner", version = "1.0.2" }
android-test-runner = { group = "androidx.test", name = "runner", version = "1.5.2" }
androidx-annotation = { group = "androidx.annotation", name = "annotation", version = "1.6.0" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version = "1.1.0" }
androidx-espresso-idlingresource = { group = "androidx.test.espresso", name = "espresso-idling-resource", version = "3.5.1" }
Expand Down Expand Up @@ -113,7 +112,8 @@ kotlin-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin",
kotlin-plugin-min = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin-plugin-min" }
kotlin-plugin-max = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin-plugin-max" }
kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect" } # the Kotlin plugin resolves the version
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin-stdlib" }
kotlin-stdlib-common = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-common", version.ref = "kotlin-stdlib" }
kotlin-stdlib-jvm = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin-stdlib" }
kotlin-stdlib-js = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-js", version.ref = "kotlin-stdlib" }
kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test" } # the Kotlin plugin resolves the version
kotlin-test-annotations-common = { group = "org.jetbrains.kotlin", name = "kotlin-test-annotations-common" } # the Kotlin plugin resolves the version
Expand Down
14 changes: 10 additions & 4 deletions libraries/apollo-annotations/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@ apolloLibrary {

kotlin {
sourceSets {
/**
* Because apollo-annotation is pulled as an API dependency in in all other modules we configure the
* Kotlin stdlib dependency here. See https://youtrack.jetbrains.com/issue/KT-53471
*/
findByName("commonMain")?.apply {
dependencies {
api(libs.kotlin.stdlib)
api(libs.jetbrains.annotations)
api(libs.kotlin.stdlib.common)
}
}
findByName("jvmMain")?.apply {
dependencies {
api(libs.kotlin.stdlib.jvm)
}
}

findByName("jsMain")?.apply {
dependencies {
// See https://youtrack.jetbrains.com/issue/KT-53471
api(libs.kotlin.stdlib.js)
}
}
Expand Down
3 changes: 3 additions & 0 deletions libraries/apollo-compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ dependencies {
testImplementation(libs.androidx.annotation) {
because("Used in the Java generated code")
}
testImplementation(libs.jetbrains.annotations) {
because("Used in the Java generated code")
}
}

abstract class GeneratePluginVersion : DefaultTask() {
Expand Down
2 changes: 1 addition & 1 deletion tests/enums/src/main/graphql/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum Gravity {
type,
}

# See https://youtrack.jetbrains.com/issue/KT-52315
# See https://youtrack.jetbrains.com/issue/KT-52315 for why this test
enum Foo {
header,
footer,
Expand Down
8 changes: 0 additions & 8 deletions tests/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ xcodeproj=samples/multiplatform/kmp-ios-app/kmp-ios-app.xcodeproj

android.useAndroidX=true


# Keep in sync with other projects
# Give more memory to the Gradle daemon
org.gradle.jvmargs=-Xmx8g
Expand All @@ -13,11 +12,4 @@ org.gradle.caching=true
# Enable the configuration cache
# org.gradle.configuration-cache=true

kotlin.mpp.androidSourceSetLayoutVersion1.nowarn=true
org.gradle.parallel=true

# See https://kotlinlang.org/docs/whatsnew-eap.html#preview-of-gradle-composite-builds-support-in-kotlin-multiplatform
kotlin.mpp.import.enableKgpDependencyResolution=true

# See https://youtrack.jetbrains.com/issue/KT-55995/Add-ability-to-perform-precise-compilation-task-outputs-backup
kotlin.compiler.preciseCompilationResultsBackup=true
3 changes: 1 addition & 2 deletions tests/idling-resource/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {
implementation(libs.androidx.espresso.idlingresource)
implementation(libs.apollo.idlingresource)
testImplementation(libs.apollo.mockserver)
testImplementation(libs.android.support.annotations)
testImplementation(libs.androidx.annotation)
testImplementation(libs.android.test.runner)
}

Expand All @@ -19,7 +19,6 @@ android {

defaultConfig {
minSdk = libs.versions.android.sdkversion.min.get().toInt()
targetSdk = libs.versions.android.sdkversion.target.get().toInt()
}
}

Expand Down
2 changes: 2 additions & 0 deletions tests/java-nullability/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ dependencies {
implementation(libs.apollo.api.java)
implementation(libs.guava.jre)
implementation(libs.androidx.annotation)
implementation(libs.jetbrains.annotations)

testImplementation(libs.junit)
}

Expand Down
5 changes: 1 addition & 4 deletions tests/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ rootProject.projectDir
include(project)
}

includeBuild("../") {
// See https://youtrack.jetbrains.com/issue/KT-56536
name = "apollo-kotlin"
}
includeBuild("../")

dependencyResolutionManagement {
versionCatalogs {
Expand Down
Loading