Skip to content

Commit

Permalink
chore: Adding license and publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
LichtHund committed Aug 31, 2023
1 parent 538cd16 commit 8e67da4
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 5 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019-2023 Matt (@LichtHund) - TriumphTeam

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
44 changes: 44 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,57 @@
plugins {
id("com.github.hierynomus.license") version "0.16.1"
id("com.gradle.plugin-publish") version "1.1.0"
kotlin("jvm") version "1.9.10"
`java-gradle-plugin`
`kotlin-dsl`

}

repositories {
mavenCentral()
}

dependencies {
implementation(gradleTestKit())
implementation(kotlin("stdlib"))
}

kotlin {
explicitApi()
}

license {
header = rootProject.file("LICENSE")
encoding = "UTF-8"
useDefaultMappings = true

include("**/*.kt")
}

gradlePlugin {
website.set("https://github.com/TriumphTeam/cataloger")
vcsUrl.set("https://github.com/TriumphTeam/cataloger.git")

plugins {
create("cataloger") {
id = "dev.triumphteam.cataloger"
displayName = "Cataloger"
description = "Yeah"
// tags.set(listOf("tags", "for", "your", "plugins"))
implementationClass = "dev.triumphteam.cataloger.CatalogerPlugin"
}
}
}

publishing {
repositories {
maven {
credentials {
username = System.getenv("REPO_USER")
password = System.getenv("REPO_PASS")
}

url = uri("https://repo.triumphteam.dev/snapshots/")
}
}
}
34 changes: 32 additions & 2 deletions src/main/kotlin/CatalogerPlugin.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
package dev.triumphteam.cataloguer
/**
* MIT License
*
* Copyright (c) 2019-2023 Matt (@LichtHund) - TriumphTeam
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package dev.triumphteam.cataloger

import dev.triumphteam.cataloguer.task.ValidateCatalogTask
import dev.triumphteam.cataloger.task.ValidateCatalogTask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.internal.catalog.parser.TomlCatalogFileParser
Expand All @@ -9,6 +32,13 @@ import org.gradle.api.plugins.catalog.internal.DefaultVersionCatalogPluginExtens
import org.gradle.kotlin.dsl.register
import java.nio.file.Path

/**
* This class represents a cataloger plugin for Gradle projects.
*
* Responsibilities:
* - Importing and combining toml catalog files
* - Registering a validator for the catalog
*/
public abstract class CatalogerPlugin : Plugin<Project> {

private companion object {
Expand Down
25 changes: 24 additions & 1 deletion src/main/kotlin/package-info.kt
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
/**
* MIT License
*
* Copyright (c) 2019-2023 Matt (@LichtHund) - TriumphTeam
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package dev.triumphteam.cataloguer
package dev.triumphteam.cataloger
27 changes: 25 additions & 2 deletions src/main/kotlin/task/ValidateCatalogTask.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
package dev.triumphteam.cataloguer.task
/**
* MIT License
*
* Copyright (c) 2019-2023 Matt (@LichtHund) - TriumphTeam
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package dev.triumphteam.cataloger.task

import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.artifacts.repositories.MavenArtifactRepository
import org.gradle.api.internal.catalog.DefaultVersionCatalog
import org.gradle.api.plugins.catalog.internal.DefaultVersionCatalogPluginExtension
Expand All @@ -13,6 +35,7 @@ import java.io.File
import java.lang.StringBuilder
import kotlin.io.path.createTempDirectory

/** A task that validates a catalog by setting up and running Gradle test files. */
public abstract class ValidateCatalogTask : DefaultTask() {

private companion object {
Expand Down

0 comments on commit 8e67da4

Please sign in to comment.