automation-plugins: convert to full plugins
This commit is contained in:
parent
504c8b466c
commit
fe3ca3f7d8
8 changed files with 29 additions and 19 deletions
|
@ -28,11 +28,15 @@ gradlePlugin {
|
|||
plugins {
|
||||
register("crowdin") {
|
||||
id = "com.github.android-password-store.crowdin-plugin"
|
||||
implementationClass = "crowdin.CrowdinDownloadPlugin"
|
||||
implementationClass = "dev.msfjarvis.aps.gradle.crowdin.CrowdinDownloadPlugin"
|
||||
}
|
||||
register("psl") {
|
||||
id = "com.github.android-password-store.psl-plugin"
|
||||
implementationClass = "psl.PublicSuffixListPlugin"
|
||||
implementationClass = "dev.msfjarvis.aps.gradle.psl.PublicSuffixListPlugin"
|
||||
}
|
||||
register("git-hooks") {
|
||||
id = "com.github.android-password-store.git-hooks"
|
||||
implementationClass = "dev.msfjarvis.aps.gradle.GitHooksPlugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
||||
* SPDX-License-Identifier: GPL-3.0-only
|
||||
*/
|
||||
|
||||
import tasks.GitHooks
|
||||
|
||||
tasks.register<GitHooks>("installGitHooks") {
|
||||
val projectDirectory = layout.projectDirectory
|
||||
hookScript.set(projectDirectory.file("scripts/pre-push-hook.sh").asFile.readText())
|
||||
hookOutput.set(projectDirectory.file(".git/hooks/pre-push").asFile)
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package dev.msfjarvis.aps.gradle
|
||||
|
||||
import dev.msfjarvis.aps.gradle.tasks.GitHooks
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.register
|
||||
|
||||
@Suppress("Unused")
|
||||
class GitHooksPlugin : Plugin<Project> {
|
||||
|
||||
override fun apply(project: Project) {
|
||||
project.tasks.register<GitHooks>("installGitHooks") {
|
||||
val projectDirectory = project.layout.projectDirectory
|
||||
hookScript.set(projectDirectory.file("scripts/pre-push-hook.sh").asFile.readText())
|
||||
hookOutput.set(projectDirectory.file(".git/hooks/pre-push").asFile)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-only
|
||||
*/
|
||||
|
||||
package crowdin
|
||||
package dev.msfjarvis.aps.gradle.crowdin
|
||||
|
||||
/** Extension for configuring [CrowdinDownloadPlugin] */
|
||||
interface CrowdinExtension {
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-only
|
||||
*/
|
||||
|
||||
package crowdin
|
||||
package dev.msfjarvis.aps.gradle.crowdin
|
||||
|
||||
import de.undercouch.gradle.tasks.download.Download
|
||||
import java.io.File
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-only
|
||||
*/
|
||||
|
||||
package psl
|
||||
package dev.msfjarvis.aps.gradle.psl
|
||||
|
||||
import okio.buffer
|
||||
import okio.sink
|
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package psl
|
||||
package dev.msfjarvis.aps.gradle.psl
|
||||
|
||||
import java.io.Serializable
|
||||
import java.util.TreeSet
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-only
|
||||
*/
|
||||
|
||||
package tasks
|
||||
package dev.msfjarvis.aps.gradle.tasks
|
||||
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
Loading…
Reference in a new issue