Skip to content

Commit

Permalink
Revert "PIN-4024 Cleaning projects (#12)"
Browse files Browse the repository at this point in the history
This reverts commit ddd6414.
  • Loading branch information
galales authored Oct 26, 2023
1 parent ddd6414 commit 0c7220c
Show file tree
Hide file tree
Showing 9 changed files with 1,827 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: sbt ++${{ matrix.scala }} test

- name: Compress target directories
run: tar cf targets.tar selfcare-v2-client/target project/target
run: tar cf targets.tar party-process-client/target party-management-client/target user-registry-client/target selfcare-v2-client/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v2
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ metals.sbt
.metals
.bsp
.openapi-generator
party-management-client/src/
party-process-client/src/
user-registry-client/src/
selfcare-v2-client/src/
.DS_Store
party-process-client/project/build.properties
party-management-client/project/build.properties
user-registry-client/project/build.properties
selfcare-v2-client/project/build.properties
.env
103 changes: 102 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,104 @@ val projectName = settingKey[String]("The project name prefix derived from the

lazy val root = (project in file("."))
.settings(name := "interop-selfcare-proxy-clients", publish / skip := true)
.aggregate(selfcareV2Client)
.aggregate(partyProcessClient, partyManagementClient, userRegistryClient, selfcareV2Client)

cleanFiles += baseDirectory.value / "party-process-client" / "src"
cleanFiles += baseDirectory.value / "party-process-client" / "target"

lazy val partyProcessClient = project
.in(file("party-process-client"))
.settings(
name := "interop-selfcare-party-process-client",
packagePrefix := name.value
.replaceFirst("interop-", "interop.")
.replaceFirst("selfcare-", "selfcare.")
.replaceFirst("party-process-", "partyprocess-.")
.replaceAll("-", ""),
projectName := name.value
.replaceFirst("interop-", "")
.replaceFirst("selfcare-", ""),
generateCode := {
Process(s"""openapi-generator-cli generate -t template/scala-akka-http-client
| -i party-process-client/interface-specification.yml
| -g scala-akka
| -p projectName=${projectName.value}
| -p invokerPackage=it.pagopa.${packagePrefix.value}.invoker
| -p modelPackage=it.pagopa.${packagePrefix.value}.model
| -p apiPackage=it.pagopa.${packagePrefix.value}.api
| -p modelPropertyNaming=original
| -p dateLibrary=java8
| -p entityStrictnessTimeout=15
| -o party-process-client""".stripMargin).!!
},
scalacOptions := Seq(),
libraryDependencies := Dependencies.Jars.client,
updateOptions := updateOptions.value.withGigahorse(false)
)

cleanFiles += baseDirectory.value / "party-management-client" / "src"
cleanFiles += baseDirectory.value / "party-management-client" / "target"

lazy val partyManagementClient = project
.in(file("party-management-client"))
.settings(
name := "interop-selfcare-party-management-client",
packagePrefix := name.value
.replaceFirst("interop-", "interop.")
.replaceFirst("selfcare-", "selfcare.")
.replaceFirst("party-management-", "partymanagement.")
.replaceAll("-", ""),
projectName := name.value
.replaceFirst("interop-", "")
.replaceFirst("selfcare-", ""),
generateCode := {
Process(s"""openapi-generator-cli generate -t template/scala-akka-http-client
| -i party-management-client/interface-specification.yml
| -g scala-akka
| -p projectName=${projectName.value}
| -p invokerPackage=it.pagopa.${packagePrefix.value}.invoker
| -p modelPackage=it.pagopa.${packagePrefix.value}.model
| -p apiPackage=it.pagopa.${packagePrefix.value}.api
| -p modelPropertyNaming=original
| -p dateLibrary=java8
| -o party-management-client""".stripMargin).!!
},
scalacOptions := Seq(),
libraryDependencies := Dependencies.Jars.client,
updateOptions := updateOptions.value.withGigahorse(false)
)

cleanFiles += baseDirectory.value / "user-registry-client" / "src"
cleanFiles += baseDirectory.value / "user-registry-client" / "target"

lazy val userRegistryClient = project
.in(file("user-registry-client"))
.settings(
name := "interop-selfcare-user-registry-client",
packagePrefix := name.value
.replaceFirst("interop-", "interop.")
.replaceFirst("selfcare-", "selfcare.")
.replaceFirst("user-registry-", "userregistry.")
.replaceAll("-", ""),
projectName := name.value
.replaceFirst("interop-", "")
.replaceFirst("selfcare-", ""),
generateCode := {
Process(s"""openapi-generator-cli generate -t template/scala-akka-http-client
| -i user-registry-client/interface-specification.yml
| -g scala-akka
| -p projectName=${projectName.value}
| -p invokerPackage=it.pagopa.${packagePrefix.value}.invoker
| -p modelPackage=it.pagopa.${packagePrefix.value}.model
| -p apiPackage=it.pagopa.${packagePrefix.value}.api
| -p modelPropertyNaming=original
| -p dateLibrary=java8
| -o user-registry-client""".stripMargin).!!
},
scalacOptions := Seq(),
libraryDependencies := Dependencies.Jars.client,
updateOptions := updateOptions.value.withGigahorse(false)
)

cleanFiles += baseDirectory.value / "selfcare-v2-client" / "src"
cleanFiles += baseDirectory.value / "selfcare-v2-client" / "target"
Expand Down Expand Up @@ -48,5 +145,9 @@ lazy val selfcareV2Client = project
libraryDependencies := Dependencies.Jars.client,
updateOptions := updateOptions.value.withGigahorse(false)
)

(Compile / compile) := ((Compile / compile) dependsOn partyProcessClient / generateCode).value
(Compile / compile) := ((Compile / compile) dependsOn partyManagementClient / generateCode).value
(Compile / compile) := ((Compile / compile) dependsOn userRegistryClient / generateCode).value
(Compile / compile) := ((Compile / compile) dependsOn selfcareV2Client / generateCode).value

27 changes: 27 additions & 0 deletions party-management-client/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
build.sbt
pom.xml
README.md
project/build.properties
Loading

0 comments on commit 0c7220c

Please sign in to comment.