This repository was archived by the owner on Aug 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSysProp.scala
103 lines (83 loc) · 3.6 KB
/
SysProp.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
* Copyright 2011-2011 Christos KK Loverdos
*
* Licensed 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.
*/
import java.util.Calendar
import sbt._
class SysProp(info: ProjectInfo) extends DefaultProject(info) {
override def compileOptions = super.compileOptions ++
Seq("-deprecation",
"-Xmigration",
"-Xcheckinit",
"-optimise",
"-explaintypes",
"-unchecked",
"-encoding", "utf8")
.map(CompileOption(_))
def extraResources = "LICENSE.txt"
override def mainResources = super.mainResources +++ extraResources
override def packageDocsJar = defaultJarPath("-javadoc.jar")
override def packageSrcJar = defaultJarPath("-sources.jar")
val sourceArtifact = Artifact.sources(artifactID)
val docsArtifact = Artifact.javadoc(artifactID)
override def packageToPublishActions = super.packageToPublishActions ++ Seq(packageDocs, packageSrc)
override def packageAction = super.packageAction dependsOn test
override def managedStyle = ManagedStyle.Maven
override def pomExtra =
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>loverdos</id>
<name>Christos KK Loverdos</name>
<email>loverdos@gmail.com</email>
</developer>
</developers>;
val lib_maybe = "com.ckkloverdos" %% "maybe" % "0.4.0-SNAPSHOT" % "compile" withSources()
val lib_converter = "com.ckkloverdos" %% "converter" % "0.4.0-SNAPSHOT" % "compile" withSources()
override def testOptions =
super.testOptions ++
Seq(TestArgument(TestFrameworks.JUnit, "-q", "-v"))
// Set up publish repository (the tuple avoids SBT's ReflectiveRepositories detection)
private lazy val ScalaToolsReleases_t = ("Scala Tools Releases" -> "http://nexus.scala-tools.org/content/repositories/releases/")
private lazy val ScalaToolsSnapshots_t = ("Scala Tools Snapshots" -> "http://nexus.scala-tools.org/content/repositories/snapshots/")
override def repositories =
if (version.toString.endsWith("-SNAPSHOT")) super.repositories + ScalaToolsSnapshots
else super.repositories
lazy val publishTo =
if (version.toString.endsWith("-SNAPSHOT")) {
println("====> publishing SNAPSHOT: " + version)
ScalaToolsSnapshots_t._1 at ScalaToolsSnapshots_t._2
}
else {
println("====> publishing RELEASE: " + version)
ScalaToolsReleases_t._1 at ScalaToolsReleases_t._2
}
Credentials(Path.userHome / ".ivy2" / ".credentials", log)
lazy val publishRemote = propertyOptional[Boolean](false, true)
private lazy val localDestRepo = Resolver.file("maven-local", Path.userHome / ".m2" / "repository" asFile)
override def defaultPublishRepository =
if (!publishRemote.value) Some(localDestRepo)
else super.defaultPublishRepository
lazy val projectInceptionYear = "2010"
private lazy val docBottom =
"Copyright (c) Christos KK Loverdos. " +
projectInceptionYear + "-" + Calendar.getInstance().get(Calendar.YEAR) +
". All Rights Reserved."
}