Skip to content

Commit e62f1b0

Browse files
authored
Simplify sjsonnew (#3)
* Simplify sjsonnew * silence mima * jfc * eh * no mima at all
1 parent 7b907aa commit e62f1b0

File tree

2 files changed

+10
-32
lines changed

2 files changed

+10
-32
lines changed

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ lazy val sbtPlugin = project
5454
Seq("-Xmx1024M", "-Dplugin.version=" + version.value),
5555
scriptedBufferLog := false,
5656
)
57+
.disablePlugins(MimaPlugin)
5758
.enablePlugins(SbtPlugin)
5859

5960
lazy val root = project

sbtPlugin/src/main/scala/org/polyvariant/smithytraitcodegen/SmithyTraitCodegen.scala

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,41 +46,18 @@ object SmithyTraitCodegen {
4646

4747
object Args {
4848

49-
// format: off
50-
private type ArgsDeconstructed = String :*: String :*: os.Path :*: PathRef :*: List[PathRef] :*: List[String] :*: LNil
51-
// format: on
52-
5349
private implicit val pathFormat: JsonFormat[os.Path] = BasicJsonProtocol
5450
.projectFormat[os.Path, File](p => p.toIO, file => os.Path(file))
5551

56-
implicit val argsIso = LList.iso[Args, ArgsDeconstructed](
57-
{
58-
args: Args => ("javaPackage", args.javaPackage) :*:
59-
("smithyNamespace", args.smithyNamespace) :*:
60-
("targetDir", args.targetDir) :*:
61-
("smithySourcesDir", args.smithySourcesDir) :*:
62-
("dependencies", args.dependencies) :*:
63-
("externalProviders", args.externalProviders) :*:
64-
LNil
65-
},
66-
{
67-
case (_, javaPackage) :*:
68-
(_, smithyNamespace) :*:
69-
(_, targetDir) :*:
70-
(_, smithySourcesDir) :*:
71-
(_, dependencies) :*:
72-
(_, externalProviders) :*:
73-
LNil =>
74-
Args(
75-
javaPackage = javaPackage,
76-
smithyNamespace = smithyNamespace,
77-
targetDir = targetDir,
78-
smithySourcesDir = smithySourcesDir,
79-
dependencies = dependencies,
80-
externalProviders = externalProviders,
81-
)
82-
},
83-
)
52+
implicit val argsFmt: JsonFormat[Args] =
53+
caseClass(Args.apply _, Args.unapply _)(
54+
"javaPackage",
55+
"smithyNamespace",
56+
"targetDir",
57+
"smithySourcesDir",
58+
"dependencies",
59+
"externalProviders",
60+
)
8461

8562
}
8663

0 commit comments

Comments
 (0)