rename 'convention' package to 'conventions'

This commit is contained in:
Adam 2022-09-18 23:32:39 +02:00
parent 42dab20210
commit 81261512f1
7 changed files with 6 additions and 6 deletions

View file

@ -0,0 +1,86 @@
@file:Suppress("PackageDirectoryMismatch")
package org.gradle.kotlin.dsl
import org.gradle.api.artifacts.dsl.RepositoryHandler
fun RepositoryHandler.jitpack() {
maven("https://jitpack.io")
}
fun RepositoryHandler.myMavenLocal(enabled: Boolean = true) {
if (enabled) {
println("Maven local is enabled")
mavenLocal {
content {
// includeGroup("dev.adamko")
// includeGroup("dev.adamko.kxtsgen")
includeGroup("io.kotest")
}
}
}
}
fun RepositoryHandler.sonatypeSnapshot() {
maven("https://oss.sonatype.org/content/repositories/snapshots") {
mavenContent {
snapshotsOnly()
includeGroup("io.kotest")
}
}
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
mavenContent {
snapshotsOnly()
includeGroup("io.kotest")
}
}
}
fun RepositoryHandler.nodeDistributions() {
// Declare the Node.js download repository
ivy("https://nodejs.org/dist/") {
name = "Node Distributions at $url"
patternLayout { artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]") }
metadataSources { artifact() }
content { includeModule("org.nodejs", "node") }
}
}
fun RepositoryHandler.yarnDistributions() {
ivy("https://github.com/yarnpkg/yarn/releases/download") {
name = "Yarn Distributions at $url"
patternLayout { artifact("v[revision]/[artifact](-v[revision]).[ext]") }
metadataSources { artifact() }
content { includeModule("com.yarnpkg", "yarn") }
}
}
// https://stackoverflow.com/a/34327202/4161471
// example: implementation("jmeter-gradle-plugin:jmeter-gradle-plugin:1.0.3@zip")
fun RepositoryHandler.gitHub() {
ivy("https://github.com/") {
patternLayout {
artifact("/[organisation]/[module]/archive/[revision].[ext]")
}
metadataSources { artifact() }
content {
includeGroup("jmeter-gradle-plugin")
}
}
}
fun RepositoryHandler.kotlinxHtml() {
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") {
mavenContent {
includeGroup("org.jetbrains.kotlinx")
}
}
}

View file

@ -0,0 +1,35 @@
package kafkatorio.conventions.settings
@Suppress("UnstableApiUsage") // Central declaration of repositories is an incubating feature
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
myMavenLocal()
mavenCentral()
jitpack()
gradlePluginPortal()
// Declare the Node.js download repository
nodeDistributions()
yarnDistributions()
maven("https://raw.githubusercontent.com/adamko-dev/kotka-streams/artifacts/m2") {
content { includeGroup("dev.adamko.kotka") }
}
kotlinxHtml()
sonatypeSnapshot()
}
pluginManagement {
repositories {
myMavenLocal()
gradlePluginPortal()
mavenCentral()
jitpack()
sonatypeSnapshot()
}
}
}