I am creating a multi-project repo. I am unable to specify a plugin version in the buildSrc scripts I have made. Is there a way to do this? I have to do this because some of the dependencies require a specific plugin version.
The repo can be found here: GitHub - LukeShay/jeffery-krueger: A simple discord bot I am using to learn Kotlin.
Here is the common gradle config:
import com.lukeshay.discord.gradle.passSystemProperties
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val hibernateVersion = "6.0.0.Alpha6"
val log4jVersion = "2.14.0"
val exposedVersion = "0.29.1"
val kotestVersion = "4.4.3"
group = "com.lukeshay.discord"
version = System.getProperty("app.version", "version")
plugins {
jacoco
id("org.jetbrains.kotlin.jvm")
}
repositories {
jcenter()
jcenter {
url = uri("https://akeyless.jfrog.io/artifactory/akeyless-java")
}
}
dependencies {
// Discord dependencies
implementation("net.dv8tion:JDA:4.2.0_228") {
exclude("opus-java")
}
implementation("org.jetbrains.kotlin:kotlin-bom")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
runtimeOnly("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2")
// Log4j dependencies
implementation("org.apache.logging.log4j:log4j-api:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-core:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion")
// Exposed dependencies
implementation("org.jetbrains.exposed:exposed-core:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-jodatime:$exposedVersion")
// JodaTime dependencies
implementation("joda-time:joda-time:2.10.10")
// Hibernate dependencies
implementation("org.hibernate.orm:hibernate-core:$hibernateVersion")
implementation("com.mchange:c3p0:0.9.5.5")
// Postgres dependencies
implementation("org.postgresql:postgresql:42.2.19")
// Test dependencies
// Kotest dependencies
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
// Mockk dependencies
testImplementation("io.mockk:mockk:1.10.6")
// Kotlin dependencies
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.2")
}
tasks.jacocoTestReport {
// Adjust the output of the test report
reports {
xml.isEnabled = true
html.isEnabled = true
csv.isEnabled = true
html.destination = file("$buildDir/jacocoHtml")
}
}
tasks.jacocoTestCoverageVerification {
classDirectories.setFrom(
files(
classDirectories.files.map {
fileTree(
mapOf(
"dir" to it,
"exclude" to arrayOf(
"com/lukeshay/discord/logging/**",
"com/lukeshay/discord/MainKt.class"
)
)
)
}
)
)
violationRules {
rule {
isFailOnViolation = false
element = "BUNDLE"
limit {
minimum = "0.7".toBigDecimal()
}
}
rule {
isFailOnViolation = false
element = "SOURCEFILE"
limit {
minimum = "0.01".toBigDecimal()
}
}
}
}
tasks.test {
useJUnitPlatform()
passSystemProperties(this)
finalizedBy(tasks.jacocoTestReport)
finalizedBy(tasks.jacocoTestCoverageVerification)
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "11"
}
Here is the application gradle config:
plugins {
id("jeffery.common")
application
}
dependencies {
// AKEYLESS dependencies
implementation("io.akeyless:akeyless-java:2.2.1")
// Sentry dependencies
implementation("io.sentry:sentry-log4j2:4.3.0")
}
Here is one of the projects gradle config:
import com.lukeshay.discord.gradle.passSystemProperties
import com.lukeshay.discord.gradle.setupHeroku
val ktorVersion: String by project
val kotlinVersion: String by project
val logbackVersion: String by project
plugins {
id("jeffery.application") apply true
id("com.heroku.sdk.heroku-gradle") version "2.0.0" apply true
id("org.jlleitschuh.gradle.ktlint") version "10.0.0" apply true
id("com.github.johnrengelman.shadow") version "6.1.0" apply true
kotlin("plugin.serialization") version "1.4.30" apply true
}
group = "com.lukeshay.discord.web"
repositories {
maven { url = uri("https://kotlin.bintray.com/ktor") }
}
dependencies {
implementation(project(":jeffery-entities"))
implementation(project(":jeffery-lib"))
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-sessions:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0")
testImplementation("io.ktor:ktor-server-tests:$ktorVersion")
}
tasks.runShadow {
passSystemProperties(this)
}
ktlint {
verbose.set(true)
outputToConsole.set(true)
coloredOutput.set(true)
reporters {
reporter(org.jlleitschuh.gradle.ktlint.reporter.ReporterType.CHECKSTYLE)
}
ignoreFailures.set(true)
}
application {
mainClassName = "io.ktor.server.netty.EngineMain"
mainClass.set("io.ktor.server.netty.EngineMain")
}
heroku {
val props = setupHeroku("jeffery-web", version.toString(), "jk-web-dev", "web")
appName = props.appName
jdkVersion = props.jdkVersion
processTypes = props.processTypes
buildpacks = props.buildpacks
includes = props.includes
isIncludeBuildDir = props.isIncludeBuildDir
}