Skip to content

Commit 98988d4

Browse files
authored
Merge pull request #47 from eed3si9n/wip/sonatype
Prep to publish to Sonatype
2 parents 0be52fc + 09dd9d0 commit 98988d4

File tree

8 files changed

+60
-19
lines changed

8 files changed

+60
-19
lines changed

build.sbt

+47-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,49 @@
1-
sbtPlugin := true
2-
enablePlugins(SbtPlugin)
1+
ThisBuild / version := {
2+
if ((ThisBuild / isSnapshot).value) "0.5.0" + "-SNAPSHOT"
3+
else (ThisBuild / version).value
4+
}
5+
ThisBuild / scalaVersion := "2.12.15"
36

4-
organization := "com.lightbend.sbt"
5-
homepage := Some(url("https://github.com/sbt/sbt-proguard"))
6-
name := "sbt-proguard"
7-
publishMavenStyle := false
7+
lazy val root = (project in file("."))
8+
.enablePlugins(SbtPlugin)
9+
.settings(nocomma {
10+
name := "sbt-proguard"
811

9-
scriptedDependencies := publishLocal.value
10-
scriptedLaunchOpts ++= Seq("-Xms512m", "-Xmx512m", s"-Dproject.version=${version.value}")
11-
//scriptedBufferLog := false
12+
scalacOptions ++= Seq(
13+
"-unchecked",
14+
"-deprecation",
15+
"-feature",
16+
"-Xlint",
17+
"-Xfatal-warnings",
18+
)
19+
20+
scriptedDependencies := publishLocal.value
21+
scriptedLaunchOpts ++= Seq("-Xms512m", "-Xmx512m", s"-Dproject.version=${version.value}")
22+
// scriptedBufferLog := false
23+
24+
pluginCrossBuild / sbtVersion := {
25+
scalaBinaryVersion.value match {
26+
case "2.12" => "1.1.6" // minimum sbt version
27+
}
28+
}
29+
})
30+
31+
Global / onChangedBuildSource := ReloadOnSourceChanges
32+
ThisBuild / organization := "com.github.sbt"
33+
ThisBuild / description := "an sbt plugin for Proguard"
34+
ThisBuild / homepage := Some(url("https://github.com/sbt/sbt-proguard"))
35+
ThisBuild / licenses := List("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.txt"))
36+
ThisBuild / developers := List(
37+
Developer(
38+
"pvlugter",
39+
"Peter Vlugter",
40+
"@pvlugter",
41+
url("https://github.com/pvlugter")
42+
)
43+
)
44+
ThisBuild / publishTo := {
45+
val nexus = "https://oss.sonatype.org/"
46+
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
47+
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
48+
}
49+
ThisBuild / dynverSonatypeSnapshots := true

project/plugins.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
2-
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13")
2+
addSbtPlugin("com.eed3si9n" % "sbt-nocomma" % "0.1.0")

src/main/scala/com/typesafe/sbt/SbtProguard.scala

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ package com.lightbend.sbt
33
import com.lightbend.sbt.proguard.Merge
44
import sbt.Keys._
55
import sbt._
6-
import sbt.internal.inc.Analysis
7-
import xsbti.PathBasedFile
8-
96
import java.nio.file.FileSystems
107
import scala.sys.process.Process
118

src/main/scala/com/typesafe/sbt/proguard/Merge.scala

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package com.lightbend.sbt.proguard
22

33
import java.io.File
4+
import java.nio.file.Files
5+
import java.nio.file.Path
46
import java.util.regex.Pattern
57

68
import sbt._
79
import scala.util.matching.Regex
810
import sbt.io.Path._
9-
import sbt.internal.inc.classpath.ClasspathUtil
1011

1112
object Merge {
1213

@@ -38,7 +39,7 @@ object Merge {
3839

3940
def entries(sources: Seq[File], tmp: File): Seq[Entry] = {
4041
sources flatMap { source =>
41-
val base = if (ClasspathUtil.isArchive(source.toPath)) {
42+
val base = if (isArchive(source.toPath)) {
4243
val path =
4344
if (source.getCanonicalPath.indexOf(":") > 0)
4445
source.getCanonicalPath.substring(source.getCanonicalPath.indexOf("\\") + 1,
@@ -53,6 +54,12 @@ object Merge {
5354
}
5455
}
5556

57+
// copy-pasted from Zinc instead of using internal code
58+
private def isArchive(file: Path): Boolean =
59+
Files.isRegularFile(file) && isArchiveName(file.getFileName.toString)
60+
61+
private def isArchiveName(fileName: String) = fileName.endsWith(".jar") || fileName.endsWith(".zip")
62+
5663
trait Strategy {
5764
def claims(path: EntryPath): Boolean
5865
def merge(path: EntryPath, entries: Seq[Entry], target: File, log: Logger): Unit
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
addSbtPlugin("com.lightbend.sbt" % "sbt-proguard" % sys.props("project.version"))
1+
addSbtPlugin("com.github.sbt" % "sbt-proguard" % sys.props("project.version"))
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
addSbtPlugin("com.lightbend.sbt" % "sbt-proguard" % sys.props("project.version"))
1+
addSbtPlugin("com.github.sbt" % "sbt-proguard" % sys.props("project.version"))
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
addSbtPlugin("com.lightbend.sbt" % "sbt-proguard" % sys.props("project.version"))
1+
addSbtPlugin("com.github.sbt" % "sbt-proguard" % sys.props("project.version"))

version.sbt

-1
This file was deleted.

0 commit comments

Comments
 (0)