Skip to content

Commit 27e605b

Browse files
committed
Initial commit
1 parent 78dee0d commit 27e605b

26 files changed

+1220
-15
lines changed

.gitignore

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1+
.DS_Store
2+
.gradle
3+
.idea
4+
.classpath
5+
.project
6+
.settings
7+
.yardoc
8+
.yardopts
9+
bin
10+
build
11+
target
12+
out
13+
*.iml
14+
*.ipr
15+
*.iws
16+
test-output
17+
Scratch.java
18+
ScratchTest.java
19+
test-results
20+
test-tmp
121
*.class
2-
*.log
3-
4-
# sbt specific
5-
dist/*
6-
target/
7-
lib_managed/
8-
src_managed/
9-
project/boot/
10-
project/plugins/project/
11-
12-
# Scala-IDE specific
13-
.scala_dependencies
22+
mods
23+
.cache

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
vertx-mysql-postgres
2-
====================
1+
# vertx-mysql-postgres
32

4-
Using https://github.com/mauricio/postgresql-async to support an async module for MySQL and PostgreSQL
3+
This Vert.x module uses the https://github.com/mauricio/postgresql-async drivers to support an async module for MySQL and PostgreSQL.
4+
5+
## Requirements
6+
7+
* Vert.x 2.0.0
8+
9+
## Installation
10+
11+
`vertx install com.campudus.async-mysql-postgresql`
12+
13+
## Configuration
14+
15+
{
16+
"connection" : <MySQL|PostgreSQL>,
17+
"host" : <your-host>,
18+
"port" : <your-port>,
19+
"username" : <your-username>,
20+
"password" : <your-password>,
21+
"database" : <name-of-your-database>
22+
}
23+
24+
* `address` - The address this module should register on the event bus. Defaults to `campudus.asyncdb`
25+
* `connection` - The database you want to use. Defaults to `PostgreSQL`.
26+
* `host` - The host of the database. Defaults to `localhost`.
27+
* `port` - The port of the database. Defaults to `5432` for PostgreSQL and `3306` for MySQL.
28+
* `username` - The username to connect to the database. Defaults to `postgres` for PostgreSQL and `root` for MySQL.
29+
* `password` - The password to connect to the database. Default is not set, i.e. it uses no password.
30+
* `database` - The name of the database you want to connect to. Defaults to `test`.

build.gradle

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
apply from: "gradle/vertx.gradle"
2+
3+
/*
4+
Usage:
5+
6+
./gradlew task_name
7+
8+
(or gradlew.bat task_name if you have the misfortune to have to use Windows)
9+
10+
If no task name is specified then the default task 'assemble' is run
11+
12+
Task names are:
13+
14+
idea - generate a skeleton IntelliJ IDEA project
15+
16+
eclipse - generate a skeleton Eclipse IDE project
17+
18+
assemble - builds the outputs, by default this is the module zip file. It can also include a jar file if produceJar
19+
in gradle.properties is set to true. Outputs are created in build/libs.
20+
if pullInDeps in gradle.properties is set to 'true' then the modules dependencies will be
21+
automatically pulled into a nested mods directory inside the module during the build
22+
23+
copyMod - builds and copies the module to the local 'mods' directory so you can execute vertx runmod (etc)
24+
directly from the command line
25+
26+
modZip - creates the module zip into build/libs
27+
28+
clean - cleans everything up
29+
30+
test - runs the tests. An nice html test report is created in build/reports/tests (index.html)
31+
32+
runMod - runs the module. This is similar to executing vertx runmod from the command line except that it does
33+
not use the version of Vert.x installed and on the PATH to run it. Instead it uses the version of Vert.x
34+
that the module was compiled and tested against.
35+
36+
runModIDEA - run the module from the project resources in IDEA. This allows you to run the module without building it
37+
first!
38+
39+
runModEclipse - run the module from the project resources in Eclipse. This allows you to run the module without
40+
building it first!
41+
42+
pullInDeps - pulls in all dependencies of the module into a nested module directory
43+
44+
uploadArchives - upload the module zip file (and jar if one has been created) to Nexus. You will need to
45+
configure sonatypeUsername and sonatypePassword in ~/.gradle/gradle.properties.
46+
47+
install - install any jars produced to the local Maven repository (.m2)
48+
49+
*/
50+
51+
dependencies {
52+
/*
53+
Add your module jar dependencies here
54+
E.g.
55+
compile "com.foo:foo-lib:1.0.1" - for compile time deps - this will end up in your module too!
56+
testCompile "com.foo:foo-lib:1.0.1" - for test time deps
57+
provided "com.foo:foo-lib:1.0.1" - if you DON'T want it to be packaged in the module zip
58+
*/
59+
60+
provided "org.scala-lang:scala-library:$scalaVersion"
61+
provided "org.scala-lang:scala-compiler:$scalaVersion"
62+
provided "io.vertx:lang-scala:$scalaLangModVersion"
63+
64+
compile "com.github.mauricio:postgresql-async_2.10:0.2.4"
65+
compile "com.github.mauricio:mysql-async_2.10:0.2.4"
66+
67+
}
68+
69+
test {
70+
/* Configure which tests are included
71+
include 'org/foo/**'
72+
exclude 'org/boo/**'
73+
*/
74+
75+
}
76+
77+
/*
78+
If you're uploading stuff to Maven, Gradle needs to generate a POM.
79+
Please edit the details below.
80+
*/
81+
def configurePom(def pom) {
82+
pom.project {
83+
name rootProject.name
84+
description 'Using MySQL/PostgreSQL async driver as a module for Vert.x'
85+
inceptionYear '2013'
86+
packaging produceJar == 'false' ? 'pom' : 'jar'
87+
88+
url 'https://github.com/campudus/vertx-mysql-postgresql'
89+
90+
developers {
91+
developer {
92+
id 'Narigo'
93+
name 'Joern Bernhardt'
94+
email 'jb@campudus.com'
95+
}
96+
}
97+
98+
scm {
99+
url 'https://github.com/campudus/vertx-mysql-postgresql'
100+
}
101+
102+
licenses {
103+
license {
104+
name 'The Apache Software License, Version 2.0'
105+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
106+
distribution 'repo'
107+
}
108+
}
109+
110+
properties {
111+
setProperty('project.build.sourceEncoding', 'UTF8')
112+
}
113+
}
114+
}

gradle.properties

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# E.g. your domain name
2+
modowner=com.campudus
3+
4+
# Your module name
5+
modname=async-mysql-postgresql
6+
7+
# Your module version
8+
version=0.1.0-SNAPSHOT
9+
10+
# The test timeout in seconds
11+
testtimeout=5
12+
13+
# Set to true if you want module dependencies to be pulled in and nested inside the module itself
14+
pullInDeps=true
15+
16+
# Set to true if you want the build to output a jar as well as a module zip file
17+
produceJar=false
18+
19+
# The version of the Scala module
20+
scalaLangModVersion=2.0.0-SNAPSHOT
21+
22+
# The version of Scala to use
23+
scalaVersion=2.10.2
24+
25+
# Gradle version
26+
gradleVersion=1.6
27+
28+
# The version of Vert.x
29+
vertxVersion=2.0.0-final
30+
31+
# The version of Vert.x test tools
32+
toolsVersion=2.0.0-final
33+
34+
# The version of JUnit
35+
junitVersion=4.10

gradle/maven.gradle

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright 2012 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
apply plugin: 'maven'
18+
apply plugin: 'signing'
19+
20+
if (!hasProperty('sonatypeUsername')) {
21+
ext.sonatypeUsername = ''
22+
}
23+
if (!hasProperty('sonatypePassword')) {
24+
ext.sonatypePassword = ''
25+
}
26+
27+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28+
// maven task configuration
29+
30+
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
31+
32+
signing {
33+
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
34+
sign configurations.archives
35+
}
36+
37+
uploadArchives {
38+
group 'build'
39+
description = "Does a maven deploy of archives artifacts"
40+
41+
repositories {
42+
mavenDeployer {
43+
// setUniqueVersion(false)
44+
45+
configuration = configurations.archives
46+
47+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
48+
authentication(userName: sonatypeUsername, password: sonatypePassword)
49+
}
50+
51+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
52+
authentication(userName: sonatypeUsername, password: sonatypePassword)
53+
}
54+
55+
if (isReleaseVersion) {
56+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
57+
}
58+
59+
configurePom(pom)
60+
}
61+
}
62+
}
63+
64+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65+
// configuration methods
66+
67+
68+

gradle/setup.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
task wrapper(type: Wrapper, description: "Create a Gradle self-download wrapper") {
3+
group = 'Project Setup'
4+
gradleVersion = rootProject.gradleVersion
5+
}

0 commit comments

Comments
 (0)