Skip to content

Commit

Permalink
Removed version from PROJECT.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
pme123 committed Jan 5, 2025
1 parent 9e68f34 commit 4292ec4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 24 deletions.
21 changes: 5 additions & 16 deletions 03-api/src/main/scala/camundala/api/ApiProjectConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,8 @@ object ApiProjectConfig:
val projectName = projectConfig.getString("projectName")
val projectVersion = projectConfig.getString("projectVersion")
val subProjects = projectConfig.getStringList("subProjects").asScala.toSeq
val dependencies = projectConfig
.getObject("dependencies")
.unwrapped()
.asScala
.map:
case k -> v =>
DependencyConfig.apply(k, v.toString)
.toSeq
val dependencies =
projectConfig.getStringList("dependencies").asScala.map(DependencyConfig.apply).toSeq

ApiProjectConfig(
projectName,
Expand Down Expand Up @@ -106,13 +100,8 @@ final case class DependencyConfig(
end DependencyConfig

object DependencyConfig:
def apply(projectName: String, version: String): DependencyConfig =
DependencyConfig(projectName, VersionConfig(version))
// "org:name:version" => DependencyConfig - only works for the company-project
def apply(dependency: String): DependencyConfig =
val dArray = dependency.replace("\"", "").split(":")
// DependencyConfig(dArray(0), dArray(1), dArray(2))
val lastVersion = VersionHelper.repoSearch(dArray(1), dArray(0))
DependencyConfig(dArray(1), VersionConfig(lastVersion))
def apply(projectName: String): DependencyConfig =
val lastVersion = VersionHelper.repoSearch(projectName)
DependencyConfig(projectName, VersionConfig(lastVersion))

end DependencyConfig
2 changes: 1 addition & 1 deletion 03-api/src/main/scala/camundala/api/VersionHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ object VersionHelper:
s"${Console.YELLOW_B}NOT FOUND!${Console.RESET} - Result from Maven Central:\n ${searchResult.out.text()}" +
s"Check: cs complete-dep $org:$project:"
)
s"VERSION NOT FOUND"
s"0.0.0"

println(s"- Last Version of $org:$project: $version")
version
Expand Down
10 changes: 5 additions & 5 deletions 03-api/src/test/PROJECT.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
projectName: mycompany-myProject
projectVersion: 1.0.0-SNAPSHOT
subProjects: [
subProject1,
subProject1
subProject2
]
dependencies: {
mastercompany-services: 1.2.4
mycompany-commons: 1.0.3
}
dependencies: [
mastercompany-services
mycompany-commons
]
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class ApiProjectConfigTest extends FunSuite:
VersionConfig("1.0.0-SNAPSHOT"),
Seq("subProject1", "subProject2"),
Seq(
DependencyConfig("mastercompany-services", "1.2.4"),
DependencyConfig("mycompany-commons", "1.0.3")
DependencyConfig("mastercompany-services"),
DependencyConfig("mycompany-commons")
)
)
)
Expand Down

0 comments on commit 4292ec4

Please sign in to comment.