diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d7f8c57 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +root = true + +[*.java] +end_of_line = lf +indent_style = tab +indent_size = 4 diff --git a/.scalafmt.conf b/.scalafmt.conf new file mode 100644 index 0000000..490aeb1 --- /dev/null +++ b/.scalafmt.conf @@ -0,0 +1,14 @@ +version = 2.7.4 + +align = none +align.openParenCallSite = false + +assumeStandardLibraryStripMargin = true + +continuationIndent.callSite = 2 +continuationIndent.defnSite = 4 + +docstrings = JavaDoc + +maxColumn = 120 + diff --git a/build.sc b/build.sc index a6fc4b0..f6a688c 100644 --- a/build.sc +++ b/build.sc @@ -8,10 +8,7 @@ import mill.scalalib.publish._ import de.tobiasroeser.mill.osgi._ import de.tobiasroeser.mill.vcs.version.VcsVersion -object main - extends MavenModule - with PublishModule - with OsgiBundleModule { +object main extends RootModule with JavaModule with PublishModule with OsgiBundleModule { override def publishVersion = VcsVersion.vcsState().format() @@ -35,8 +32,9 @@ object main override def artifactName = "domino-java" override def bundleSymbolicName = "domino.java" - override def osgiHeaders = T { - super.osgiHeaders().copy( + override def osgiHeaders = super + .osgiHeaders() + .copy( `Import-Package` = Seq( """org.slf4j.*;version="[1.7,3)";resolution:=optional""", "de.tototec.utils.functional.*;resolution:=optional", @@ -47,9 +45,6 @@ object main s"""domino.java.capsule""" ) ) - } - - override def millSourcePath = super.millSourcePath / os.up override def pomSettings: mill.T[mill.scalalib.publish.PomSettings] = T { PomSettings( @@ -61,7 +56,6 @@ object main developers = Seq( Developer(id = "lefou", name = "Tobias Roeser", url = "https://github.com/lefou") ) - ) } @@ -80,36 +74,13 @@ object main override def javadocOptions: T[Seq[String]] = super.javadocOptions() ++ Seq("-Xdoclint:none") -// def docletIvyDeps = T { -// Agg( -// Deps.asciiDoclet -// ) -// } - -// def docletClasspath = T { -// resolveDeps(docletIvyDeps) -// } - override def generatedSources = T { val dest = T.ctx().dest Seq("README.adoc", "LICENSE.txt").foreach(f => os.copy.into(millSourcePath / f, dest)) Seq(PathRef(dest)) } -// override def javadocOptions = Seq( -// "-doclet", "org.asciidoctor.Asciidoclet", -// "-docletpath", s"${docletClasspath().map(_.path).mkString(File.pathSeparator)}", -// "-overview", s"${millSourcePath / "README.adoc"}", -// "--base-dir", s"${millSourcePath}", -// "--attributes-file", s"${millSourcePath / 'src / 'main / 'doc / "placeholders.adoc"}", -// "--attribute", s"name=${artifactName}", -// "--attribute", s"version=${publishVersion}", -// "--attribute", s"dominojavaversion=${publishVersion}", -// "--attribute", s"title-link=${url}[${bundleSymbolicName} ${publishVersion}]", -// "--attribute", "env-asciidoclet=true" -// ) - - object test extends MavenModuleTests with TestModule.Junit4 { + object test extends JavaModuleTests with TestModule.Junit4 { override def ivyDeps = T { super.ivyDeps() ++ Agg( Deps.lambdaTest, @@ -123,4 +94,3 @@ object main } } - diff --git a/src/main/java/domino/java/OsgiContext.java b/src/domino/java/OsgiContext.java similarity index 100% rename from src/main/java/domino/java/OsgiContext.java rename to src/domino/java/OsgiContext.java diff --git a/src/main/java/domino/java/ServiceConsuming.java b/src/domino/java/ServiceConsuming.java similarity index 100% rename from src/main/java/domino/java/ServiceConsuming.java rename to src/domino/java/ServiceConsuming.java diff --git a/src/main/java/domino/java/ServiceProviderCapsule.java b/src/domino/java/ServiceProviderCapsule.java similarity index 100% rename from src/main/java/domino/java/ServiceProviderCapsule.java rename to src/domino/java/ServiceProviderCapsule.java diff --git a/src/main/java/domino/java/ServiceProviding.java b/src/domino/java/ServiceProviding.java similarity index 100% rename from src/main/java/domino/java/ServiceProviding.java rename to src/domino/java/ServiceProviding.java diff --git a/src/main/java/domino/java/ServiceWatcherCapsule.java b/src/domino/java/ServiceWatcherCapsule.java similarity index 100% rename from src/main/java/domino/java/ServiceWatcherCapsule.java rename to src/domino/java/ServiceWatcherCapsule.java diff --git a/src/main/java/domino/java/ServiceWatcherContext.java b/src/domino/java/ServiceWatcherContext.java similarity index 100% rename from src/main/java/domino/java/ServiceWatcherContext.java rename to src/domino/java/ServiceWatcherContext.java diff --git a/src/main/java/domino/java/ServiceWatcherEvent.java b/src/domino/java/ServiceWatcherEvent.java similarity index 100% rename from src/main/java/domino/java/ServiceWatcherEvent.java rename to src/domino/java/ServiceWatcherEvent.java diff --git a/src/main/java/domino/java/ServiceWatching.java b/src/domino/java/ServiceWatching.java similarity index 100% rename from src/main/java/domino/java/ServiceWatching.java rename to src/domino/java/ServiceWatching.java diff --git a/src/main/java/domino/java/Util.java b/src/domino/java/Util.java similarity index 100% rename from src/main/java/domino/java/Util.java rename to src/domino/java/Util.java diff --git a/src/main/java/domino/java/capsule/Capsule.java b/src/domino/java/capsule/Capsule.java similarity index 100% rename from src/main/java/domino/java/capsule/Capsule.java rename to src/domino/java/capsule/Capsule.java diff --git a/src/main/java/domino/java/capsule/CapsuleContext.java b/src/domino/java/capsule/CapsuleContext.java similarity index 100% rename from src/main/java/domino/java/capsule/CapsuleContext.java rename to src/domino/java/capsule/CapsuleContext.java diff --git a/src/main/java/domino/java/capsule/CapsuleScope.java b/src/domino/java/capsule/CapsuleScope.java similarity index 100% rename from src/main/java/domino/java/capsule/CapsuleScope.java rename to src/domino/java/capsule/CapsuleScope.java diff --git a/src/main/java/domino/java/capsule/DefaultCapsuleScope.java b/src/domino/java/capsule/DefaultCapsuleScope.java similarity index 100% rename from src/main/java/domino/java/capsule/DefaultCapsuleScope.java rename to src/domino/java/capsule/DefaultCapsuleScope.java diff --git a/src/main/java/domino/java/capsule/DynamicCapsuleContext.java b/src/domino/java/capsule/DynamicCapsuleContext.java similarity index 100% rename from src/main/java/domino/java/capsule/DynamicCapsuleContext.java rename to src/domino/java/capsule/DynamicCapsuleContext.java diff --git a/src/main/java/domino/java/capsule/DynamicVariable.java b/src/domino/java/capsule/DynamicVariable.java similarity index 100% rename from src/main/java/domino/java/capsule/DynamicVariable.java rename to src/domino/java/capsule/DynamicVariable.java diff --git a/src/main/java/domino/java/internal/Logger.java b/src/domino/java/internal/Logger.java similarity index 100% rename from src/main/java/domino/java/internal/Logger.java rename to src/domino/java/internal/Logger.java diff --git a/src/main/java/domino/java/internal/LoggerFactory.java b/src/domino/java/internal/LoggerFactory.java similarity index 100% rename from src/main/java/domino/java/internal/LoggerFactory.java rename to src/domino/java/internal/LoggerFactory.java diff --git a/src/main/doc/placeholders.adoc b/src/main/doc/placeholders.adoc deleted file mode 100644 index 293088e..0000000 --- a/src/main/doc/placeholders.adoc +++ /dev/null @@ -1 +0,0 @@ -:testkey: testval \ No newline at end of file diff --git a/src/test/resources/logback.xml b/test/resources/logback.xml similarity index 100% rename from src/test/resources/logback.xml rename to test/resources/logback.xml diff --git a/src/test/java/domino/java/ServiceProvidingTest.java b/test/src/domino/java/ServiceProvidingTest.java similarity index 98% rename from src/test/java/domino/java/ServiceProvidingTest.java rename to test/src/domino/java/ServiceProvidingTest.java index db71d9e..3fc7cbd 100644 --- a/src/test/java/domino/java/ServiceProvidingTest.java +++ b/test/src/domino/java/ServiceProvidingTest.java @@ -70,7 +70,7 @@ class Activator extends OsgiContext { public Activator() { whenBundleActive(bc -> { providesService(exampleService, MyService.class, - Util.asMap("prop1", "value1", "prop2", 3)); + Util.asMap("prop1", "value1", "prop2", 3)); }); } } @@ -83,7 +83,7 @@ public Activator() { expectEquals(ref.getProperty("prop2"), 3); expectEquals(sr.getServiceReference(MyService2.class.getName()), null); expectNotEquals(sr.getServiceReferences(MyService.class.getName(), "(&(prop1=value1)(prop2=3))"), - null); + null); activator.stop(sr.getBundleContext()); expectEquals(sr.getServiceReference(MyService.class.getName()), null); diff --git a/src/test/java/domino/java/test/FelixConnectHelper.java b/test/src/domino/java/test/FelixConnectHelper.java similarity index 100% rename from src/test/java/domino/java/test/FelixConnectHelper.java rename to test/src/domino/java/test/FelixConnectHelper.java