From d122ad44157051f36c11328f0845c0cd543e2da6 Mon Sep 17 00:00:00 2001 From: Stefan Zeiger Date: Thu, 21 Nov 2024 21:54:51 +0100 Subject: [PATCH] Some build improvements --- build.sbt | 23 +++++++++++++++---- .../perfio/AccumulatingBufferedOutput.java | 0 .../main/java/perfio/ArrayBufferedOutput.java | 0 .../main/java/perfio/BlockBufferedOutput.java | 0 .../src}/main/java/perfio/BufferIterator.java | 0 .../src}/main/java/perfio/BufferedInput.java | 0 .../src}/main/java/perfio/BufferedOutput.java | 0 .../src}/main/java/perfio/CloseableView.java | 0 .../main/java/perfio/DirectBufferedInput.java | 0 .../main/java/perfio/DirectLineTokenizer.java | 0 .../main/java/perfio/HeapBufferedInput.java | 0 .../main/java/perfio/HeapLineTokenizer.java | 0 .../src}/main/java/perfio/LineBuffer.java | 0 .../src}/main/java/perfio/LineTokenizer.java | 0 .../main/java/perfio/ScalarLineTokenizer.java | 0 .../perfio/StreamingHeapBufferedInput.java | 0 .../perfio/SwitchingHeapBufferedInput.java | 0 .../src}/main/java/perfio/TextOutput.java | 0 .../java/perfio/VectorizedLineTokenizer.java | 0 .../main/java/perfio/internal/BufferUtil.java | 0 .../java/perfio/internal/StringInternals.java | 0 .../java/perfio/internal/VectorSupport.java | 0 .../java/perfio/internal/package-info.java | 2 ++ core/src/main/java/perfio/package-info.java | 2 ++ 24 files changed, 23 insertions(+), 4 deletions(-) rename {src => core/src}/main/java/perfio/AccumulatingBufferedOutput.java (100%) rename {src => core/src}/main/java/perfio/ArrayBufferedOutput.java (100%) rename {src => core/src}/main/java/perfio/BlockBufferedOutput.java (100%) rename {src => core/src}/main/java/perfio/BufferIterator.java (100%) rename {src => core/src}/main/java/perfio/BufferedInput.java (100%) rename {src => core/src}/main/java/perfio/BufferedOutput.java (100%) rename {src => core/src}/main/java/perfio/CloseableView.java (100%) rename {src => core/src}/main/java/perfio/DirectBufferedInput.java (100%) rename {src => core/src}/main/java/perfio/DirectLineTokenizer.java (100%) rename {src => core/src}/main/java/perfio/HeapBufferedInput.java (100%) rename {src => core/src}/main/java/perfio/HeapLineTokenizer.java (100%) rename {src => core/src}/main/java/perfio/LineBuffer.java (100%) rename {src => core/src}/main/java/perfio/LineTokenizer.java (100%) rename {src => core/src}/main/java/perfio/ScalarLineTokenizer.java (100%) rename {src => core/src}/main/java/perfio/StreamingHeapBufferedInput.java (100%) rename {src => core/src}/main/java/perfio/SwitchingHeapBufferedInput.java (100%) rename {src => core/src}/main/java/perfio/TextOutput.java (100%) rename {src => core/src}/main/java/perfio/VectorizedLineTokenizer.java (100%) rename {src => core/src}/main/java/perfio/internal/BufferUtil.java (100%) rename {src => core/src}/main/java/perfio/internal/StringInternals.java (100%) rename {src => core/src}/main/java/perfio/internal/VectorSupport.java (100%) create mode 100644 core/src/main/java/perfio/internal/package-info.java create mode 100644 core/src/main/java/perfio/package-info.java diff --git a/build.sbt b/build.sbt index 23e647e..b804933 100644 --- a/build.sbt +++ b/build.sbt @@ -9,6 +9,8 @@ Global / version := "0.1-SNAPSHOT" //cancelable in Global := false +val release = "22" + val runtimeOpts = Seq( "--add-modules", "jdk.incubator.vector", "--add-opens", "java.base/jdk.internal.misc=ALL-UNNAMED", @@ -16,10 +18,12 @@ val runtimeOpts = Seq( ) val compileOpts = Seq( "--add-modules", "jdk.incubator.vector", + "--release", release, ) javaOptions in Global ++= runtimeOpts javacOptions in Global ++= compileOpts +scalacOptions in Global ++= Seq("-java-output-version", release) // javaOptions in Global += "-Djmh.blackhole.autoDetect=false" @@ -33,8 +37,16 @@ Global / scalaVersion := "3.5.2" val hedgehogVersion = "0.10.1" -lazy val main = (project in file(".")) - .aggregate(LocalProject("bench"), LocalProject("test"), LocalProject("scalaApi")) +lazy val root = (project in file(".")) + .aggregate(LocalProject("core"), LocalProject("bench"), LocalProject("test"), LocalProject("scalaApi")) + .settings( + crossPaths := false, + autoScalaLibrary := false, + name := "perfio-root", + publish / skip := true, + ) + +lazy val core = (project in file("core")) .settings( crossPaths := false, autoScalaLibrary := false, @@ -42,9 +54,10 @@ lazy val main = (project in file(".")) ) lazy val scalaApi = (project in file("scalaapi")) - .dependsOn(main) + .dependsOn(core) .settings( name := "perfio-scala", + publish / skip := true, ) lazy val bench = (project in file("bench")) @@ -76,9 +89,10 @@ lazy val test_ = Project("test", file("test")) ) lazy val protoRuntime = (project in file("proto-runtime")) - .dependsOn(main) + .dependsOn(core) .settings( name := "perfio-proto-runtime", + publish / skip := true, ) lazy val proto = (project in file("proto")) @@ -102,6 +116,7 @@ lazy val proto = (project in file("proto")) val outs = cachedCompile(srcs ++ cp.iterator.map(_.data).toSet).toSeq.sorted outs }.taskValue, + publish / skip := true, ) lazy val protoBench = (project in file("proto-bench")) diff --git a/src/main/java/perfio/AccumulatingBufferedOutput.java b/core/src/main/java/perfio/AccumulatingBufferedOutput.java similarity index 100% rename from src/main/java/perfio/AccumulatingBufferedOutput.java rename to core/src/main/java/perfio/AccumulatingBufferedOutput.java diff --git a/src/main/java/perfio/ArrayBufferedOutput.java b/core/src/main/java/perfio/ArrayBufferedOutput.java similarity index 100% rename from src/main/java/perfio/ArrayBufferedOutput.java rename to core/src/main/java/perfio/ArrayBufferedOutput.java diff --git a/src/main/java/perfio/BlockBufferedOutput.java b/core/src/main/java/perfio/BlockBufferedOutput.java similarity index 100% rename from src/main/java/perfio/BlockBufferedOutput.java rename to core/src/main/java/perfio/BlockBufferedOutput.java diff --git a/src/main/java/perfio/BufferIterator.java b/core/src/main/java/perfio/BufferIterator.java similarity index 100% rename from src/main/java/perfio/BufferIterator.java rename to core/src/main/java/perfio/BufferIterator.java diff --git a/src/main/java/perfio/BufferedInput.java b/core/src/main/java/perfio/BufferedInput.java similarity index 100% rename from src/main/java/perfio/BufferedInput.java rename to core/src/main/java/perfio/BufferedInput.java diff --git a/src/main/java/perfio/BufferedOutput.java b/core/src/main/java/perfio/BufferedOutput.java similarity index 100% rename from src/main/java/perfio/BufferedOutput.java rename to core/src/main/java/perfio/BufferedOutput.java diff --git a/src/main/java/perfio/CloseableView.java b/core/src/main/java/perfio/CloseableView.java similarity index 100% rename from src/main/java/perfio/CloseableView.java rename to core/src/main/java/perfio/CloseableView.java diff --git a/src/main/java/perfio/DirectBufferedInput.java b/core/src/main/java/perfio/DirectBufferedInput.java similarity index 100% rename from src/main/java/perfio/DirectBufferedInput.java rename to core/src/main/java/perfio/DirectBufferedInput.java diff --git a/src/main/java/perfio/DirectLineTokenizer.java b/core/src/main/java/perfio/DirectLineTokenizer.java similarity index 100% rename from src/main/java/perfio/DirectLineTokenizer.java rename to core/src/main/java/perfio/DirectLineTokenizer.java diff --git a/src/main/java/perfio/HeapBufferedInput.java b/core/src/main/java/perfio/HeapBufferedInput.java similarity index 100% rename from src/main/java/perfio/HeapBufferedInput.java rename to core/src/main/java/perfio/HeapBufferedInput.java diff --git a/src/main/java/perfio/HeapLineTokenizer.java b/core/src/main/java/perfio/HeapLineTokenizer.java similarity index 100% rename from src/main/java/perfio/HeapLineTokenizer.java rename to core/src/main/java/perfio/HeapLineTokenizer.java diff --git a/src/main/java/perfio/LineBuffer.java b/core/src/main/java/perfio/LineBuffer.java similarity index 100% rename from src/main/java/perfio/LineBuffer.java rename to core/src/main/java/perfio/LineBuffer.java diff --git a/src/main/java/perfio/LineTokenizer.java b/core/src/main/java/perfio/LineTokenizer.java similarity index 100% rename from src/main/java/perfio/LineTokenizer.java rename to core/src/main/java/perfio/LineTokenizer.java diff --git a/src/main/java/perfio/ScalarLineTokenizer.java b/core/src/main/java/perfio/ScalarLineTokenizer.java similarity index 100% rename from src/main/java/perfio/ScalarLineTokenizer.java rename to core/src/main/java/perfio/ScalarLineTokenizer.java diff --git a/src/main/java/perfio/StreamingHeapBufferedInput.java b/core/src/main/java/perfio/StreamingHeapBufferedInput.java similarity index 100% rename from src/main/java/perfio/StreamingHeapBufferedInput.java rename to core/src/main/java/perfio/StreamingHeapBufferedInput.java diff --git a/src/main/java/perfio/SwitchingHeapBufferedInput.java b/core/src/main/java/perfio/SwitchingHeapBufferedInput.java similarity index 100% rename from src/main/java/perfio/SwitchingHeapBufferedInput.java rename to core/src/main/java/perfio/SwitchingHeapBufferedInput.java diff --git a/src/main/java/perfio/TextOutput.java b/core/src/main/java/perfio/TextOutput.java similarity index 100% rename from src/main/java/perfio/TextOutput.java rename to core/src/main/java/perfio/TextOutput.java diff --git a/src/main/java/perfio/VectorizedLineTokenizer.java b/core/src/main/java/perfio/VectorizedLineTokenizer.java similarity index 100% rename from src/main/java/perfio/VectorizedLineTokenizer.java rename to core/src/main/java/perfio/VectorizedLineTokenizer.java diff --git a/src/main/java/perfio/internal/BufferUtil.java b/core/src/main/java/perfio/internal/BufferUtil.java similarity index 100% rename from src/main/java/perfio/internal/BufferUtil.java rename to core/src/main/java/perfio/internal/BufferUtil.java diff --git a/src/main/java/perfio/internal/StringInternals.java b/core/src/main/java/perfio/internal/StringInternals.java similarity index 100% rename from src/main/java/perfio/internal/StringInternals.java rename to core/src/main/java/perfio/internal/StringInternals.java diff --git a/src/main/java/perfio/internal/VectorSupport.java b/core/src/main/java/perfio/internal/VectorSupport.java similarity index 100% rename from src/main/java/perfio/internal/VectorSupport.java rename to core/src/main/java/perfio/internal/VectorSupport.java diff --git a/core/src/main/java/perfio/internal/package-info.java b/core/src/main/java/perfio/internal/package-info.java new file mode 100644 index 0000000..b6b00de --- /dev/null +++ b/core/src/main/java/perfio/internal/package-info.java @@ -0,0 +1,2 @@ +/// Internal classes for use by other PerfIO components. Not public API. +package perfio.internal; diff --git a/core/src/main/java/perfio/package-info.java b/core/src/main/java/perfio/package-info.java new file mode 100644 index 0000000..d859732 --- /dev/null +++ b/core/src/main/java/perfio/package-info.java @@ -0,0 +1,2 @@ +/// PerfIO API +package perfio;