Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala API - please review #51

Closed
wants to merge 66 commits into from
Closed
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
07b4b64
quite some refactoring...
Narigo Aug 29, 2013
d2caeef
a whole lot of refactoring to get complete java api...
Narigo Sep 4, 2013
aa021bb
Provide only wrapping functionality around java RecordParser.
Narigo Sep 6, 2013
67e227c
kick old tests
Narigo Sep 6, 2013
f8ec3a6
Buffer.append()
Narigo Sep 6, 2013
67373f1
not working event bus stuff
Narigo Sep 10, 2013
26e293e
Merge remote-tracking branch 'official/master' into complete-api
Narigo Sep 10, 2013
912397c
event bus message typing
Narigo Sep 15, 2013
630d7fc
kicked unused conversion (Message[X] => Unit to Handler[Message[X]])
Narigo Sep 15, 2013
0b4fc29
register / unregister handler (locally might work)
Narigo Sep 16, 2013
5653788
clean up package objects
Narigo Sep 16, 2013
ad75c30
forgot body in message... :)
Narigo Sep 16, 2013
11d264d
refactoring
Narigo Sep 16, 2013
ad62c5b
An execution context for Vert.x to stay on the same thread
Narigo Sep 16, 2013
61121b6
reimplemented SharedData - there are many open questions for this..
Narigo Sep 16, 2013
b65085d
HttpClient still missing and everything above core.http package to check
Narigo Sep 16, 2013
58defbf
completed API and started switching to idiomatic scala
McHunkyTrunk Sep 17, 2013
ef5aa5a
a small issue regarding the event bus :(
McHunkyTrunk Sep 17, 2013
d4eec90
that's a lot of stuff. please someone write testtools and tests!
Narigo Sep 18, 2013
622faa2
Remove unnecessary Map of handlers
Narigo Sep 18, 2013
36e6afe
removed VertxConverters
Narigo Sep 18, 2013
df18353
private[this] trait VertxWrapper to not expose it to users
Narigo Sep 18, 2013
db81657
Provide apply methods to Pump factory
Narigo Sep 18, 2013
81e37bc
test runner for scala (not working)
Narigo Sep 18, 2013
7a2686b
Allow running Scala scripts (as well as Scala classes)
galderz Sep 13, 2013
4c51ebc
code review + put all scripts (VerticleClass!) into src/test/scripts
Narigo Sep 19, 2013
ecdbae0
fix build script stuff to be able to use TestVerticle
Narigo Sep 19, 2013
ee77c4d
a few tests (mostly stubs)
Narigo Sep 20, 2013
e45bd6f
unnecessary test (done in HttpTestForSimpleApi.scala now)
McHunkyTrunk Sep 20, 2013
1365d09
Rename module zip to properly use vert.x module naming scheme.
raniejade Sep 18, 2013
e34fde2
Remove credentials not in use
galderz Sep 23, 2013
757d97a
Enable incremental compilation.
raniejade Sep 18, 2013
05cfea5
Name the ZIP file correctly using the classifier
galderz Sep 23, 2013
fae0f1f
Add missing metadata for the Vert.x Module Registry
galderz Sep 23, 2013
54f6535
Merge remote-tracking branch 'official/master' into complete-api
Narigo Sep 26, 2013
7c70385
deleted unnecessary file
Narigo Sep 26, 2013
32ec376
rely on compileJava and compileScala
Narigo Sep 26, 2013
f809eac
add sources to ./gradlew install task again
Narigo Sep 26, 2013
8da265a
TestVerticle now uses JavaClassRunner and is only available in /test
Narigo Sep 27, 2013
f03a6e6
class loader fixes and a few fixes for test
Narigo Sep 29, 2013
8cc79d8
http tests (incomplete) and start of websocket tests
SaschaSchmidt Sep 23, 2013
de6b14e
head and connect requests working
SaschaSchmidt Sep 23, 2013
1366f81
WebSocket PingPongTest complete and fileSystem tests (incomplete)
SaschaSchmidt Sep 26, 2013
37f06a0
complete the fileSystemTests
SaschaSchmidt Sep 27, 2013
006fe04
BufferTests for String, Int, Byte, Long, Float, Short, Buffer and Double
SaschaSchmidt Sep 27, 2013
1cd5a5c
bufferTests complete
SaschaSchmidt Sep 27, 2013
fea7f77
bufferTests complete
SaschaSchmidt Sep 27, 2013
fd72027
first NetTests complete
SaschaSchmidt Sep 27, 2013
2ed3f14
fixed chmod test
Narigo Sep 30, 2013
bfc9832
classloading
Narigo Sep 30, 2013
75c568e
PumpTests starts and FileTest chmod test complete
SaschaSchmidt Sep 30, 2013
00903a9
buffer refactorings and kicked out unused proprietary vert.x Future
Narigo Sep 30, 2013
01da37e
pump tests
Narigo Oct 1, 2013
dc4a4ff
feature warnings
Narigo Oct 1, 2013
9def7b5
Trying to get scripts/interpreting to run again
Narigo Oct 1, 2013
b1c56b2
consistency for sending Int as primitive type
Narigo Oct 1, 2013
c49ea1c
kicked println
Narigo Oct 1, 2013
0c5efa2
scala SharedData added (no tests yet)
Narigo Oct 1, 2013
703c4c1
check for buffer length not toString
Narigo Oct 1, 2013
8224845
added event bus tests
Narigo Oct 1, 2013
089c6e2
not sure if needed .=scala for interpreter test.
Narigo Oct 14, 2013
4fb8b1b
Added DnsClient API
Narigo Oct 14, 2013
23b0f10
added test stub for DnsClient API
Narigo Oct 14, 2013
16b294c
use vert.x 2.0.3-SNAPSHOT
Narigo Oct 15, 2013
35a72b6
ported DnsExceptions to scala
Narigo Oct 15, 2013
906e954
Added Try to AsyncResult implicit, to enable users to pattern match
Narigo Oct 15, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 126 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,131 @@
apply from: "gradle/vertx.gradle"

/*
* Copyright 2012 the original author or authors.
*
* 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.
Usage:

./gradlew task_name

(or gradlew.bat task_name if you have the misfortune to have to use Windows)

If no task name is specified then the default task 'assemble' is run

Task names are:

idea - generate a skeleton IntelliJ IDEA project

eclipse - generate a skeleton Eclipse IDE project

assemble - builds the outputs, by default this is the module zip file. It can also include a jar file if produceJar
in gradle.properties is set to true. Outputs are created in build/libs.
if pullInDeps in gradle.properties is set to 'true' then the modules dependencies will be
automatically pulled into a nested mods directory inside the module during the build

copyMod - builds and copies the module to the local 'mods' directory so you can execute vertx runmod (etc)
directly from the command line

modZip - creates the module zip into build/libs

clean - cleans everything up

test - runs the tests. An nice html test report is created in build/reports/tests (index.html)

runMod - runs the module. This is similar to executing vertx runmod from the command line except that it does
not use the version of Vert.x installed and on the PATH to run it. Instead it uses the version of Vert.x
that the module was compiled and tested against.

runModIDEA - run the module from the project resources in IDEA. This allows you to run the module without building it
first!

runModEclipse - run the module from the project resources in Eclipse. This allows you to run the module without
building it first!

pullInDeps - pulls in all dependencies of the module into a nested module directory

uploadArchives - upload the module zip file (and jar if one has been created) to Nexus. You will need to
configure sonatypeUsername and sonatypePassword in ~/.gradle/gradle.properties.

install - install any jars produced to the local Maven repository (.m2)

*/
apply from: "gradle/setup.gradle"
apply from: "gradle/vertx.gradle"

dependencies { }
dependencies {
/*
Add your module jar dependencies here
E.g.
compile "com.foo:foo-lib:1.0.1" - for compile time deps - this will end up in your module too!
testCompile "com.foo:foo-lib:1.0.1" - for test time deps
provided "com.foo:foo-lib:1.0.1" - if you DON'T want it to be packaged in the module zip
*/

compile "org.scala-lang:scala-library:$scalaVersion"
compile "org.scala-lang:scala-compiler:$scalaVersion"

}

test {
systemProperty 'vertx.test.timeout', 10
}
/* Configure which tests are included
include 'org/foo/**'
exclude 'org/boo/**'
*/

jvmArgs "-XX:MaxPermSize=256m"
systemProperty 'vertx.test.resources', 'src/test/testscripts'
}

/*
If you're uploading stuff to Maven, Gradle needs to generate a POM.
Please edit the details below.
*/
def configurePom(def pom) {
pom.project {
name rootProject.name
description 'Vert.x module that provides Scala support'
inceptionYear '2013'
packaging 'jar'

url 'http://vertx.io'

developers {
developer {
id 'swilliams-vmw'
name 'Stuart Williams'
}
developer {
id 'edgarchan'
name 'Edgar Chan'
}
developer {
id 'nfmelendez'
name 'Nicolas Melendez'
}
developer {
id 'Narigo'
name 'Joern Bernhardt'
}
developer {
id 'raniejade'
name 'Ranie Jade Ramiso'
}
developer {
id 'galderz'
name 'Galder Zamarreño'
}
}

scm {
url 'https://github.com/vert-x/mod-lang-scala'
}

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}

properties {
setProperty('project.build.sourceEncoding', 'UTF8')
}
}
}
39 changes: 36 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
# E.g. your domain name
modowner=io.vertx

# Your module name
modname=lang-scala

# Your module version
version=0.2.0-SNAPSHOT

# The test timeout in seconds
testtimeout=10

# Set to true if you want module dependencies to be pulled in and nested inside the module itself
pullInDeps=true

# Set to true if you want to build a fat executable jar containing everything needed to run the module
createFatJar=true

# Scala version
scalaVersion=2.10.2

# Gradle version
gradleVersion=1.6
vertxVersion=2.0.1-final
toolsVersion=2.0.0-final

# The version of Vert.x
vertxVersion=2.0.3-SNAPSHOT

# The version of Vert.x test tools
toolsVersion=2.0.2-SNAPSHOT

# The version of JUnit
junitVersion=4.11
scalaVersion=2.10.2

# Command line arguments to use when running any of the variations of ./gradlew runMod
# These are the exact same command line args that you would pass to 'vertx runmod <module-name>' on the command line
runModArgs=-conf conf.json

# e.g.
# runModArgs=-conf foo.json
# runModArgs=-conf someconf.json -ha
# runModArgs=-cluster
137 changes: 24 additions & 113 deletions gradle/maven.gradle
Original file line number Diff line number Diff line change
@@ -17,50 +17,11 @@
apply plugin: 'maven'
apply plugin: 'signing'

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// custom maven tasks

task sourceJar(type: Jar) {
description = 'Builds a source jar artifact suitable for maven deployment.'
classifier = 'sources'
from sourceSets.main.scala
}

task javadocJar(type: Jar) {
description = 'Builds a javadoc jar artifact suitable for maven deployment.'
classifier = 'javadoc'
from javadoc.destinationDir
}
javadocJar.dependsOn javadoc

build.dependsOn sourceJar, javadocJar

artifacts {
archives sourceJar, javadocJar
}

def loadProperties(String sourceFileName) {
def config = new Properties()
def propFile = new File(sourceFileName)
if (propFile.canRead()) {
config.load(new FileInputStream(propFile))
for (Map.Entry property in config) {
project.ext[property.key] = property.value;
}
}
}

// We have to explicitly load props from the user home dir - on CI we set
// GRADLE_USER_HOME to a different dir to avoid problems with concurrent builds corrupting
// a shared Maven local and using Gradle wrapper concurrently
loadProperties("${System.getProperty('user.home')}/.gradle/gradle.properties")


if (!hasProperty('sonatypeUsername')) {
ext.sonatypeUsername = ''
ext.sonatypeUsername = ''
}
if (!hasProperty('sonatypePassword')) {
ext.sonatypePassword = ''
ext.sonatypePassword = ''
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -69,89 +30,39 @@ if (!hasProperty('sonatypePassword')) {
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

uploadArchives {
group 'build'
description = "Does a maven deploy of archives artifacts"
group 'build'
description = "Does a maven deploy of archives artifacts"

repositories {
mavenDeployer {
setUniqueVersion(false)
repositories {
mavenDeployer {
// setUniqueVersion(false)

configuration = configurations.archives
configuration = configurations.archives

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

if (isReleaseVersion) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
if (isReleaseVersion) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}

configurePom(pom)
}
}
configurePom(pom)
}
}
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// configuration methods

def configurePom(def pom) {
pom.project {
name rootProject.name
description 'Vert.x module that provides Scala support'
inceptionYear '2013'
packaging 'jar'
url 'http://vertx.io'

developers {
developer {
id 'swilliams-vmw'
name 'Stuart Williams'
}
developer {
id 'edgarchan'
name 'Edgar Chan'
}
developer {
id 'nfmelendez'
name 'Nicolas Melendez'
}
developer {
id 'Narigo'
name 'Joern Bernhardt'
}
developer {
id 'raniejade'
name 'Ranie Jade Ramiso'
}
developer {
id 'galderz'
name 'Galder Zamarreño'
}
}

scm {
url 'https://github.com/vert-x/mod-lang-scala'
}

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}

properties {
setProperty('project.build.sourceEncoding', 'UTF8')
}
}
}


Loading