Skip to content

Commit

Permalink
Indicated that Gradle caching should be used, and cleaned up some dep…
Browse files Browse the repository at this point in the history
…endency info
  • Loading branch information
i3ats committed Aug 25, 2024
1 parent 361a0e3 commit 4884185
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 40 deletions.
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("java")
kotlin("jvm")
id("io.freefair.lombok")
alias(libs.plugins.org.jetbrains.kotlin.jvm)
alias(libs.plugins.io.freefair.lombok)
}

group = "org.example"
Expand All @@ -13,6 +13,7 @@ repositories {

dependencies {
implementation(libs.guice)
implementation(libs.guava)
implementation(libs.auto.service.annotations)
annotationProcessor(libs.auto.service)
testImplementation(platform(libs.junit.bom))
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.gradle.caching=true
org.gradle.configuration-cache=true
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

[plugins]

org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
io-freefair-lombok = { id = "io.freefair.lombok", version.ref = "lombok" }
org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "2.0.20" }
io-freefair-lombok = { id = "io.freefair.lombok", version = "8.10" }

[versions]

junit = "5.11.0"
kotlin = "2.0.20"
lombok = "8.4"
lombok = "8.10"

[libraries]

# DI and Services
auto-service = "com.google.auto.service:auto-service:1.1.1"
auto-service-annotations = "com.google.auto.service:auto-service-annotations:1.1.1"
guice = "com.google.inject:guice:7.0.0"
guava = "com.google.guava:guava:33.3.0-jre"
javax-inject = "javax.inject:javax.inject:1"

# Testing
junit-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter" }

# Logging
log4j-core = "org.apache.logging.log4j:log4j-core:2.23.1"
log4j-api = "org.apache.logging.log4j:log4j-api:2.23.1"

kotlin-scripting-compiler-embeddable = { group = "org.jetbrains.kotlin", name = "kotlin-scripting-compiler-embeddable", version.ref = "kotlin" }

kotlin-build-tools-impl = { module = "org.jetbrains.kotlin:kotlin-build-tools-impl" }
2 changes: 1 addition & 1 deletion modules/some-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("java")
id("io.freefair.lombok")
alias(libs.plugins.io.freefair.lombok)
}

group = "org.example"
Expand Down
2 changes: 1 addition & 1 deletion modules/some-impl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("java")
id("io.freefair.lombok")
alias(libs.plugins.io.freefair.lombok)
}

group = "org.example"
Expand Down
4 changes: 0 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,5 @@ plugins {
id("de.fayard.refreshVersions")
}

// Include the module located in the 'modules/some-api' folder
include(":modules:some-api")
include(":modules:some-impl")

//// Set the project directory for the ':some-api' module
//project(":some-api").projectDir = file("modules/some-api")
4 changes: 3 additions & 1 deletion src/main/java/com/joevno/exampleproject/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public static void main(String[] args) {

// Now imagine that we need to build stuff that is aware of a Model
val model = loadModelFromFile();
// By creating a child, we inherit all the Module bindings from the parent

// By creating a child, we inherit all the Module bindings from the parent,
// and we have the opportunity to inject our runtime dependency (Model)
val modelInjector = baseInjector.createChildInjector(new ModelModule(model));
val service = modelInjector.getInstance(ModelService.class);
service.performService();
Expand Down
25 changes: 0 additions & 25 deletions versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,3 @@
####
#### suppress inspection "SpellCheckingInspection" for whole file
#### suppress inspection "UnusedProperty" for whole file

## unused
version.javax.inject..javax.inject=1

version.kotlin=1.8.10

## unused
version.junit=5.10.0

## unused
version.com.google.inject..guice=7.0.0

## unused
version.com.google.auto.service..auto-service-annotations=1.1.1

## unused
version.com.google.auto.service..auto-service=1.1.1

## unused
version.org.apache.logging.log4j..log4j-core=2.20.0

## unused
version.org.apache.logging.log4j..log4j-api=2.20.0

plugin.io.freefair.lombok=8.4

0 comments on commit 4884185

Please sign in to comment.