Skip to content

Commit

Permalink
Forma Android v0.1.0 (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepango authored Jul 9, 2023
1 parent 26fb981 commit ca63e7c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 43 deletions.
4 changes: 1 addition & 3 deletions plugins/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "tools.forma"
version = "0.0.1"
version = "0.1.0"

tasks.named("compileKotlin", KotlinCompilationTask::class.java) {
compilerOptions {
Expand Down Expand Up @@ -37,10 +37,8 @@ gradlePlugin {
implementationClass = "tools.forma.android.plugin.FormaPlugin"
tags.set(
listOf(
"gradle",
"kotlin",
"android",
"plugin",
"structure",
"dependencies",
"module",
Expand Down
40 changes: 1 addition & 39 deletions plugins/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,47 +1,9 @@
import com.gradle.publish.PublishPlugin

plugins {
`kotlin-dsl`
id("com.gradle.plugin-publish") version "1.1.0" apply false
id("com.gradle.plugin-publish") version "1.2.0" apply false
}

class FormaRootConfigurationException(
override val message: String,
override val cause: Throwable? = null
) : Exception()

subprojects {
plugins.whenPluginAdded {
when (this) {
is PublishPlugin -> registerPublishingTasks()
}
}
}

fun Project.registerPublishingTasks() {
/**
* Workaround from https://github.com/gradle/gradle/issues/1246
*/
val pluginPublishKeysSetup = tasks.register("pluginPublishKeysSetup") {
doLast {
val key = System.getenv("GRADLE_PUBLISH_KEY")
val secret = System.getenv("GRADLE_PUBLISH_SECRET")

if (key == null || secret == null) throw GradleException(
"gradlePublishKey and/or gradlePublishSecret are not defined environment variables"
)

System.setProperty("gradle.publish.key", key)
System.setProperty("gradle.publish.secret", secret)
}
}

tasks.named("publishPlugins").configure {
dependsOn(pluginPublishKeysSetup)
}
}


tasks.register("publishPluginsToMavenLocal") {
dependsOn(subprojects.map { "${it.path}:publishToMavenLocal" })
}
2 changes: 1 addition & 1 deletion plugins/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ pluginManagement {

plugins {
id("convention-dependencies")
id("tools.forma.includer") version "0.1.3"
id("tools.forma.includer") version "0.2.0"
}

0 comments on commit ca63e7c

Please sign in to comment.