Skip to content

Commit

Permalink
Merge pull request #87 from gradle/ot/fix/improve-publishing-fix-swift
Browse files Browse the repository at this point in the history
Fix build missing Swift on Linux and publishing plugins
  • Loading branch information
octylFractal authored May 30, 2024
2 parents 3aac942 + c9dc064 commit 939778f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ object UnifiedPrototypeProject : Project({
param("env.JAVA_HOME", "%linux.java17.openjdk.64bit%")
param("env.ANDROID_HOME", "/opt/android/sdk")
param("env.ANDROID_SDK_ROOT", "/opt/android/sdk")
// Add Swift to the path
param("env.PATH", "/opt/swift/latest/usr/bin:%env.PATH%")
}

val buildAndTest = buildType {
Expand Down
25 changes: 19 additions & 6 deletions unified-prototype/unified-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@ subprojects {
version = "0.1.2-SNAPSHOT"
}

tasks.register("publishAllPlugins") {
val publishAllPlugins = tasks.register("publishAllPlugins") {
description = "Publish all plugins in the build"
dependsOn(
":plugin-android:publishPlugins",
":plugin-jvm:publishPlugins",
":plugin-kmp:publishPlugins",
)
}
subprojects {
plugins.withId("build-logic.publishing") {
publishAllPlugins.configure {
dependsOn(tasks.named("publishPlugins"))
}
}
}

val publishAllPluginsToMavenLocal = tasks.register("publishAllPluginsToMavenLocal") {
description = "Publish all plugins in the build to the Maven Local repository"
}
subprojects {
plugins.withId("build-logic.publishing") {
publishAllPluginsToMavenLocal.configure {
dependsOn(tasks.named("publishToMavenLocal"))
}
}
}
12 changes: 9 additions & 3 deletions unified-prototype/unified-plugin/plugin-swift/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@ gradlePlugin {
plugins {
create("swift-library") {
id = "org.gradle.experimental.swift-library"
displayName = "Swift Library Experimental Declarative Plugin"
description = "Experimental declarative plugin for Swift libraries"
implementationClass = "org.gradle.api.experimental.swift.StandaloneSwiftLibraryPlugin"
tags = setOf("declarative-gradle")
tags = setOf("declarative-gradle", "swift")
}
create("swift-application") {
id = "org.gradle.experimental.swift-application"
displayName = "Swift Application Experimental Declarative Plugin"
description = "Experimental declarative plugin for Swift applications"
implementationClass = "org.gradle.api.experimental.swift.StandaloneSwiftApplicationPlugin"
tags = setOf("declarative-gradle")
tags = setOf("declarative-gradle", "swift")
}
create("swift-ecosystem") {
id = "org.gradle.experimental.swift-ecosystem"
displayName = "Swift Ecosystem Experimental Declarative Plugin"
description = "Experimental declarative plugin for the Swift ecosystem"
implementationClass = "org.gradle.api.experimental.swift.SwiftEcosystemPlugin"
tags = setOf("declarative-gradle")
tags = setOf("declarative-gradle", "swift")
}
}
}

0 comments on commit 939778f

Please sign in to comment.