8000 refactored build script for easier c&p between projects · vert-x/mod-mysql-postgresql@2edfe19 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2edfe19

Browse files
refactored build script for easier c&p between projects
Signed-off-by: Joern Bernhardt <jb@campudus.com>
1 parent 0096720 commit 2edfe19

File tree

1 file changed

+66
-74
lines changed

1 file changed

+66
-74
lines changed

project/VertxScalaBuild.scala

Lines changed: 66 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,70 @@ object Variables {
1010
val scalaVersion = "2.10.4"
1111
val crossScalaVersions = Seq("2.10.4", "2.11.2")
1212
val description = "Fully async MySQL / PostgreSQL module for Vert.x"
13+
14+
val vertxVersion = "2.1.2"
15+
val testtoolsVersion = "2.0.3-final"
16+
val hamcrestVersion = "1.3"
17+
val junitInterfaceVersion = "0.10"
18+
val vertxLangScalaVersion = "1.1.0-M1"
19+
val asyncDriverVersion = "0.2.15"
20+
21+
val pomExtra =
22+
<inceptionYear>2013</inceptionYear>
23+
<url>http://vertx.io</url>
24+
<licenses>
25+
<license>
26+
<name>Apache License, Version 2.0</name>
27+
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
28+
<distribution>repo</distribution>
29+
</license>
30+
</licenses>
31+
<scm>
32+
<connection>scm:git:git://github.com/vert-x/mod-mysql-postgresql.git</connection>
33+
<developerConnection>scm:git:ssh://git@github.com/vert-x/mod-mysql-postgresql.git</developerConnection>
34+
<url>https://github.com/vert-x/mod-mysql-postgresql</url>
35+
</scm>
36+
<developers>
37+
<developer>
38+
<id>Narigo</id>
39+
<name>Joern Bernhardt</name>
40+
<email>jb@campudus.com</email>
41+
</developer>
42+
<developer>
43+
<id>Zwergal</id>
44+
<name>Max Stemplinger</name>
45+
<email>ms@campudus.com</email>
46+
</developer>
47+
</developers>
48+
49+
}
50+
51+
object Dependencies {
52+
53+
import Variables._
54+
55+
val test = List(
56+
"io.vertx" % "testtools" % testtoolsVersion % "test",
57+
"org.hamcrest" % "hamcrest-library" % hamcrestVersion % "test",
58+
"com.novocode" % "junit-interface" % junitInterfaceVersion % "test"
59+
)
60+
61+
val compile = List(
62+
"io.vertx" % "vertx-core" % vertxVersion % "provided",
63+
"io.vertx" % "vertx-platform" % vertxVersion % "provided",
64+
"io.vertx" %% "lang-scala" % vertxLangScalaVersion % "provided",
65+
"com.github.mauricio" %% "postgresql-async" % asyncDriverVersion % "compile" excludeAll(
66+
ExclusionRule(organization = "org.scala-lang"),
67+
ExclusionRule(organization = "io.netty"),
68+
ExclusionRule(organization = "org.slf4j")
69+
),
70+
"com.github.mauricio" %% "mysql-async" % asyncDriverVersion % "compile" excludeAll(
71+
ExclusionRule(organization = "org.scala-lang"),
72+
ExclusionRule(organization = "io.netty"),
73+
ExclusionRule(organization = "org.slf4j")
74+
)
75+
) ::: test
76+
1377
}
1478

1579
object VertxScalaBuild extends Build {
@@ -40,7 +104,7 @@ object VertxScalaBuild extends Build {
40104
javaOptions in Test += s"-Dvertx.modulename=${organization.value}~${name.value}_${getMajor(scalaVersion.value)}~${version.value}",
41105
resourceGenerators in Compile += Def.task {
42106
val file = (resourceManaged in Compile).value / "langs.properties"
43-
val contents = s"scala=io.vertx~lang-scala_${getMajor(scalaVersion.value)}~${Dependencies.Versions.vertxLangScalaVersion}:org.vertx.scala.platform.impl.ScalaVerticleFactory\n.scala=scala\n"
107+
val contents = s"scala=io.vertx~lang-scala_${getMajor(scalaVersion.value)}~${Variables.vertxLangScalaVersion}:org.vertx.scala.platform.impl.ScalaVerticleFactory\n.scala=scala\n"
44108
IO.write(file, contents, StandardCharsets.UTF_8)
45109
Seq(file)
46110
}.taskValue,
@@ -58,32 +122,7 @@ object VertxScalaBuild extends Build {
58122
else
59123
Some("Sonatype Releases" at sonatype + "service/local/staging/deploy/maven2")
60124
},
61-
pomExtra :=
62-
<inceptionYear>2013</inceptionYear>
63-
<url>http://vertx.io</url>
64-
<licenses>
65-
<license>
66-
<name>Apache License, Version 2.0</name>
67-
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
68-
<distribution>repo</distribution>
69-
</license>
70-
</licenses>
71-
<scm>
72-
<connection>scm:git:git://github.com/vert-x/mod-mysql-postgresql.git</connection>
73-
<developerConnection>scm:git:ssh://git@github.com/vert-x/mod-mysql-postgresql.git</developerConnection>
74-
<url>https://github.com/vert-x/mod-mysql-postgresql</url>
75-
</scm>
76-
<developers>
77-
<developer>
78-
<id>Narigo</id>
79-
<name>Joern Bernhardt</name>
80-
<email>jb@campudus.com</email>
81-
</developer>
82-
<developer>
83-
<id>Zwergal</id>
84-
<name>Max Stemplinger</name>
85-
</developer>
86-
</developers>
125+
pomExtra := Variables.pomExtra
87126
)
88127
).settings(addArtifact(Artifact(Variables.name, "zip", "zip", "mod"), zipMod).settings: _*)
89128

@@ -144,50 +183,3 @@ object VertxScalaBuild extends Build {
144183
}
145184

146185
}
147-
148-
object Dependencies {
149-
150-
object Versions {
151-
val vertxVersion = "2.1.2"
152-
val testtoolsVersion = "2.0.3-final"
153-
val hamcrestVersion = "1.3"
154-
val junitInterfaceVersion = "0.10"
155-
val vertxLangScalaVersion = "1.1.0-M1"
156-
val asyncDriverVersion = "0.2.15"
157-
}
158-
159-
object Compile {
160-
161-
import Dependencies.Versions._
162-
163-
val vertxCore = "io.vertx" % "vertx-core" % vertxVersion % "provided"
164-
val vertxPlatform = "io.vertx" % "vertx-platform" % vertxVersion % "provided"
165-
val vertxLangScala = "io.vertx" %% "lang-scala" % vertxLangScalaVersion % "provided"
166-
val postgreSqlDriver = ("com.github.mauricio" %% "postgresql-async" % asyncDriverVersion % "compile").excludeAll(
167-
ExclusionRule(organization = "org.scala-lang"),
168-
ExclusionRule(organization = "io.netty"),
169-
ExclusionRule(organization = "org.slf4j")
170-
)
171-
val mySqlDriver = ("com.github.mauricio" %% "mysql-async" % asyncDriverVersion % "compile"). excludeAll(
172-
ExclusionRule(organization = "org.scala-lang"),
173-
ExclusionRule(organization = "io.netty"),
174-
ExclusionRule(organization = "org.slf4j")
175-
)
176-
}
177-
178-
object Test {
179-
180-
import Dependencies.Versions._
181-
182-
val vertxTesttools = "io.vertx" % "testtools" % testtoolsVersion % "test"
183-
val hamcrest = "org.hamcrest" % "hamcrest-library" % hamcrestVersion % "test"
184-
val junitInterface = "com.novocode" % "junit-interface" % junitInterfaceVersion % "test"
185-
}
186-
187-
import Dependencies.Compile._
188-
189-
val test = List(Test.vertxTesttools, Test.hamcrest, Test.junitInterface)
190-
191-
val compile = List(vertxCore, vertxPlatform, vertxLangScala, postgreSqlDriver, mySqlDriver) ::: test
192-
193-
}

0 commit comments

Comments
 (0)
0