From 773380b9fe004abf3f2b94994c35e787c750f871 Mon Sep 17 00:00:00 2001 From: Iurii Malchenko Date: Sun, 3 Jan 2021 21:02:57 +0200 Subject: [PATCH] fix binary embedded file generation (missing "," when multi-line) --- CHANGELOG.md | 3 +++ README.md | 4 ++-- embedded-files-macro/version.sbt | 2 +- sbt-plugin/build.sbt | 2 +- .../embedded/sbt/EmbeddedFilesPlugin.scala | 2 +- .../embedded/sbt/binary/test_bin_file_1_bin.scala | 1 + .../embedded/sbt/binary/test_bin_file_1.bin | Bin 16 -> 32 bytes 7 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e990334..1e1180e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.1.1 + +Bug-fix release. ## 0.1.0 Initial release. diff --git a/README.md b/README.md index a1f4602..f355416 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,13 @@ And an acompanying macro to more easily access those objects. ### `plugins.sbt` ```scala -addSbtPlugin("com.yurique" % "sbt-embedded-files" % "0.1.0") +addSbtPlugin("com.yurique" % "sbt-embedded-files" % "0.1.1") ``` ### `build.sbt` ```scala - libraryDependencies += "com.yurique" %%% "embedded-files-macro" % "0.1.0" + libraryDependencies += "com.yurique" %%% "embedded-files-macro" % "0.1.1" ``` ## Example usage diff --git a/embedded-files-macro/version.sbt b/embedded-files-macro/version.sbt index e765444..e4149a8 100644 --- a/embedded-files-macro/version.sbt +++ b/embedded-files-macro/version.sbt @@ -1 +1 @@ -version in ThisBuild := "0.1.0" +version in ThisBuild := "0.1.1" diff --git a/sbt-plugin/build.sbt b/sbt-plugin/build.sbt index 1721de7..3fcc969 100644 --- a/sbt-plugin/build.sbt +++ b/sbt-plugin/build.sbt @@ -1,4 +1,4 @@ -ThisBuild / version := "0.1.0" +ThisBuild / version := "0.1.1" ThisBuild / organization := "com.yurique" ThisBuild / description := "An sbt plugin that generates scala objects embedding the contents of files." ThisBuild / bintrayRepository := "sbt-plugins" diff --git a/sbt-plugin/src/main/scala/com/yurique/embedded/sbt/EmbeddedFilesPlugin.scala b/sbt-plugin/src/main/scala/com/yurique/embedded/sbt/EmbeddedFilesPlugin.scala index 21b8baa..fa98c19 100644 --- a/sbt-plugin/src/main/scala/com/yurique/embedded/sbt/EmbeddedFilesPlugin.scala +++ b/sbt-plugin/src/main/scala/com/yurique/embedded/sbt/EmbeddedFilesPlugin.scala @@ -237,7 +237,7 @@ object EmbeddedFilesPlugin extends AutoPlugin { .map("0x" + _) .mkString(", ") ) - .mkString("\n ")} + .mkString(",\n ")} | ) | |} diff --git a/sbt-plugin/src/sbt-test/sbt-embedded-files/with-index/expected/__embedded_files/com/yurique/embedded/sbt/binary/test_bin_file_1_bin.scala b/sbt-plugin/src/sbt-test/sbt-embedded-files/with-index/expected/__embedded_files/com/yurique/embedded/sbt/binary/test_bin_file_1_bin.scala index 9e8e390..baa6bca 100644 --- a/sbt-plugin/src/sbt-test/sbt-embedded-files/with-index/expected/__embedded_files/com/yurique/embedded/sbt/binary/test_bin_file_1_bin.scala +++ b/sbt-plugin/src/sbt-test/sbt-embedded-files/with-index/expected/__embedded_files/com/yurique/embedded/sbt/binary/test_bin_file_1_bin.scala @@ -5,6 +5,7 @@ object test_bin_file_1_bin extends __embedded_files.EmbeddedBinFile { val path: String = """com/yurique/embedded/sbt/binary/test_bin_file_1.bin""" val content: Array[Byte] = Array( + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f ) diff --git a/sbt-plugin/src/sbt-test/sbt-embedded-files/with-index/src/main/scala/com/yurique/embedded/sbt/binary/test_bin_file_1.bin b/sbt-plugin/src/sbt-test/sbt-embedded-files/with-index/src/main/scala/com/yurique/embedded/sbt/binary/test_bin_file_1.bin index b66efb8adab7795606f4ebbc70be4c0a1d047a52..8ef0470545843da9067de626909b0c6907586fe9 100644 GIT binary patch literal 32 acmZQzWMXDvWn<^yO~S;{yN;@Br}u literal 16 XcmZQzWMXDvWn<^yLnc0=NKq