You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2018/04/05 21:58:22 UTC

[2/2] logging-log4j-scala git commit: Add rat report to site output

Add rat report to site output


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/commit/1b0d2a30
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/tree/1b0d2a30
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/diff/1b0d2a30

Branch: refs/heads/master
Commit: 1b0d2a303a4b33b31edbcc38527de091d832c787
Parents: ca9a452
Author: Matt Sicker <bo...@gmail.com>
Authored: Thu Apr 5 16:58:13 2018 -0500
Committer: Matt Sicker <bo...@gmail.com>
Committed: Thu Apr 5 16:58:13 2018 -0500

----------------------------------------------------------------------
 build.sbt                         | 44 +++++++++++++++++--------------
 project/CopyResourcesPlugin.scala | 48 ----------------------------------
 project/plugins.sbt               |  4 ++-
 src/asciidoctor/index.adoc        |  3 ++-
 4 files changed, 29 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/blob/1b0d2a30/build.sbt
----------------------------------------------------------------------
diff --git a/build.sbt b/build.sbt
index 722267f..130f45b 100644
--- a/build.sbt
+++ b/build.sbt
@@ -14,10 +14,9 @@
  * See the license for the specific language governing permissions and
  * limitations under the license.
  */
-import Dependencies._
-import OsgiKeys._
 
-enablePlugins(org.apache.logging.log4j.scala.sbt.copyresources.CopyResourcesPlugin)
+import Dependencies._
+import com.typesafe.sbt.osgi.SbtOsgi.autoImport.OsgiKeys._
 
 lazy val metadataSettings = Seq(
   organization := "org.apache.logging.log4j",
@@ -75,17 +74,20 @@ lazy val publishSettings = Seq(
   updateOptions := updateOptions.value.withGigahorse(false)
 )
 
-lazy val packagingSettings = Seq(
-  extraResources := Seq(
-    (baseDirectory.value / "LICENSE.txt", "META-INF/LICENSE"),
-    (baseDirectory.value / "NOTICE.txt", "META-INF/NOTICE")
-  ),
-  unmanagedSources in Compile := {
-    val Some((_, minor)) = CrossVersion.partialVersion(scalaVersion.value)
-    val extras = if (minor > 10) ((sourceDirectory.value / "main" / "scala-2.11+") ** "*.scala").get else Nil
-    (unmanagedSources in Compile).value ++ extras
-  }
-)
+lazy val licensePackagingSettings =
+  for (task <- Seq(packageBin, packageSrc, packageDoc)) yield
+    mappings in (Compile, task) ++= Seq(
+      (baseDirectory.value / "LICENSE.txt", "META-INF/LICENSE"),
+      (baseDirectory.value / "NOTICE.txt", "META-INF/NOTICE")
+    )
+
+lazy val sourceSettings = Seq(
+    unmanagedSources in Compile := {
+      val Some((_, minor)) = CrossVersion.partialVersion(scalaVersion.value)
+      val extras = if (minor > 10) ((sourceDirectory.value / "main" / "scala-2.11+") ** "*.scala").get else Nil
+      (unmanagedSources in Compile).value ++ extras
+    }
+  )
 
 lazy val releaseSettings = Seq(
   releaseCrossBuild := true
@@ -93,7 +95,11 @@ lazy val releaseSettings = Seq(
 
 lazy val siteSettings = Seq(
   apiURL := Some(url(s"https://logging.apache.org/log4j/scala/api/${version.value}/")),
-  siteSubdirName in SiteScaladoc := s"api/${version.value}"
+  siteSubdirName in SiteScaladoc := s"api/${version.value}",
+  managedSources in Asciidoc += {
+    (auditReport in Compile).value
+    (target in Compile).value / "rat.adoc"
+  }
 )
 
 lazy val apiDependencies = Seq(
@@ -115,18 +121,16 @@ lazy val bundleSettings = osgiSettings ++ Seq(
 
 lazy val root = (project in file("."))
   .settings(name := "log4j-api-scala")
+  .enablePlugins(AsciidocPlugin, SiteScaladocPlugin, SbtOsgi, Distributions)
   .settings(metadataSettings: _*)
   .settings(compileSettings: _*)
   .settings(publishSettings: _*)
-  .settings(packagingSettings: _*)
+  .settings(licensePackagingSettings: _*)
+  .settings(sourceSettings: _*)
   .settings(releaseSettings: _*)
   .settings(siteSettings: _*)
   .settings(apiDependencies: _*)
-  .enablePlugins(AsciidoctorPlugin)
-  .enablePlugins(SiteScaladocPlugin)
-  .enablePlugins(SbtOsgi)
   .settings(bundleSettings: _*)
-  .enablePlugins(Distributions)
 
 lazy val nopublish = Seq(
   publish := {},

http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/blob/1b0d2a30/project/CopyResourcesPlugin.scala
----------------------------------------------------------------------
diff --git a/project/CopyResourcesPlugin.scala b/project/CopyResourcesPlugin.scala
deleted file mode 100644
index 1f62257..0000000
--- a/project/CopyResourcesPlugin.scala
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.scala.sbt.copyresources
-
-import sbt.Keys._
-import sbt._
-
-/**
-  * Simple SBT plugin to copy in configured files into all output jars.
-  */
-object CopyResourcesPlugin extends AutoPlugin {
-
-  object autoImport {
-    val extraResources = taskKey[Seq[(File, String)]]("Additional files to copy into packages")
-
-    lazy val baseCopyResourceSettings: Seq[Setting[_]] = Seq(
-      extraResources := Nil
-    ) ++ addExtraResourcesInAll(Compile)(packageBin, packageSrc, packageDoc)
-
-    def addExtraResourcesIn(configuration: Configuration, task: ScopedTaskable[File]): Setting[Task[Seq[(File, String)]]] =
-      mappings in (configuration, task) ++= extraResources.value
-
-    def addExtraResourcesInAll(configurations: Configuration*)(tasks: ScopedTaskable[File]*): Seq[Setting[Task[Seq[(File, String)]]]] =
-      for {
-        configuration <- configurations
-        scope <- tasks
-      } yield addExtraResourcesIn(configuration, scope)
-  }
-
-  import autoImport._
-
-  override lazy val projectSettings: Seq[Setting[_]] = baseCopyResourceSettings
-
-}

http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/blob/1b0d2a30/project/plugins.sbt
----------------------------------------------------------------------
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 2b5dba0..fedf504 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -20,4 +20,6 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-license-report" % "1.2.0")
 addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.2")
 addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.0")
 addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.3")
-addSbtPlugin("org.musigma" % "sbt-rat" % "0.5.0")
+// for quicker resolutions from Maven Central of new releases, uncomment:
+//resolvers += Resolver.sonatypeRepo("public")
+addSbtPlugin("org.musigma" % "sbt-rat" % "0.5.1")

http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/blob/1b0d2a30/src/asciidoctor/index.adoc
----------------------------------------------------------------------
diff --git a/src/asciidoctor/index.adoc b/src/asciidoctor/index.adoc
index 41239dc..b1c80dc 100644
--- a/src/asciidoctor/index.adoc
+++ b/src/asciidoctor/index.adoc
@@ -32,10 +32,11 @@ include::build.adoc[]
 
 include::contributing.adoc[]
 
+include::../../target/rat.adoc[]
+
 ////
 TODO:
 * Apache logo
-* License report
 * Project links
 * Dependency report
 ////
\ No newline at end of file