bugfixes for the twitter example (thanks Daniel!)
- schedule only 1 timer activity
- fix hashtag identification
- cleanup build files
diff --git a/subprojects/s4-core/src/main/java/org/apache/s4/core/ProcessingElement.java b/subprojects/s4-core/src/main/java/org/apache/s4/core/ProcessingElement.java
index 804b9b5..1576044 100644
--- a/subprojects/s4-core/src/main/java/org/apache/s4/core/ProcessingElement.java
+++ b/subprojects/s4-core/src/main/java/org/apache/s4/core/ProcessingElement.java
@@ -356,9 +356,6 @@
             return this;
 
         timer = new Timer();
-        logger.info("Created timer for PE prototype [{}] with interval [{}].", this.getClass().getName(),
-                timerIntervalInMilliseconds);
-        timer.schedule(new OnTimeTask(), 0, timerIntervalInMilliseconds);
         return this;
     }
 
@@ -482,7 +479,8 @@
         /* Start timer. */
         if (timer != null) {
             timer.schedule(new OnTimeTask(), 0, timerIntervalInMilliseconds);
-            logger.info("Started timer for PE [{}] with ID [{}].", this.getClass().getName(), id);
+            logger.debug("Started timer for PE prototype [{}], ID [{}] with interval [{}].", new String[] {
+                    this.getClass().getName(), id, String.valueOf(timerIntervalInMilliseconds) });
         }
 
         /* Check if this PE is annotated as thread safe. */
diff --git a/test-apps/simple-deployable-app-1/build.gradle b/test-apps/simple-deployable-app-1/build.gradle
index ad4dca5..6933b58 100644
--- a/test-apps/simple-deployable-app-1/build.gradle
+++ b/test-apps/simple-deployable-app-1/build.gradle
@@ -39,8 +39,8 @@
 project.ext["s4Version"] = '0.5.0-SNAPSHOT'
 description = 'Apache S4 App'
 //defaultTasks 'installS4R'
-archivesBaseName = "$project.name"
-distRootFolder = "$archivesBaseName-${-> version}"
+project.ext["archivesBaseName"] = "$project.name"
+project.ext["distRootFolder"] = "$archivesBaseName-${-> version}"
 
 
 // Append the suffix 'SNAPSHOT' when the build is not for release.
diff --git a/test-apps/simple-deployable-app-2/build.gradle b/test-apps/simple-deployable-app-2/build.gradle
index ad4dca5..6933b58 100644
--- a/test-apps/simple-deployable-app-2/build.gradle
+++ b/test-apps/simple-deployable-app-2/build.gradle
@@ -39,8 +39,8 @@
 project.ext["s4Version"] = '0.5.0-SNAPSHOT'
 description = 'Apache S4 App'
 //defaultTasks 'installS4R'
-archivesBaseName = "$project.name"
-distRootFolder = "$archivesBaseName-${-> version}"
+project.ext["archivesBaseName"] = "$project.name"
+project.ext["distRootFolder"] = "$archivesBaseName-${-> version}"
 
 
 // Append the suffix 'SNAPSHOT' when the build is not for release.
diff --git a/test-apps/twitter-adapter/build.gradle b/test-apps/twitter-adapter/build.gradle
index c0f3576..06c5a29 100644
--- a/test-apps/twitter-adapter/build.gradle
+++ b/test-apps/twitter-adapter/build.gradle
@@ -34,13 +34,13 @@
 /* Set the destination where we want to install the apps. */
 //s4AppInstallDir = "/tmp/s4Apps" // TODO: decide how to standarize dirs, use env var?
 
-s4AppInstallDir = hasProperty('appsDir') ? "$appsDir" : "/tmp/appsDir"
+project.ext["s4AppInstallDir"] = hasProperty('appsDir') ? "$appsDir" : "/tmp/appsDir"
 
-s4Version = '0.5.0-SNAPSHOT'
+project.ext["s4Version"] = '0.5.0-SNAPSHOT'
 description = 'Apache S4 App'
 //defaultTasks 'installS4R'
-archivesBaseName = "$project.name"
-distRootFolder = "$archivesBaseName-${-> version}"
+project.ext["archivesBaseName"] = "$project.name"
+project.ext["distRootFolder"] = "$archivesBaseName-${-> version}"
 
 
 // Append the suffix 'SNAPSHOT' when the build is not for release.
@@ -63,7 +63,7 @@
 repositories {
     mavenLocal()
     mavenCentral()
-    mavenRepo name: "gson", urls: "http://google-gson.googlecode.com/svn/mavenrepo"
+    mavenRepo name: "gson", url: "http://google-gson.googlecode.com/svn/mavenrepo"
 
     /* Add lib dir as a repo. Some jar files that are not available
      in a public repo are distributed in the lib dir. */
@@ -71,7 +71,7 @@
 }
 
 /* All project libraries must be defined here. */
-libraries = [
+project.ext["libraries"] = [
            twitter4j_core:     'org.twitter4j:twitter4j-core:2.2.5',
            twitter4j_stream:   'org.twitter4j:twitter4j-stream:2.2.5',
            s4_base:            'org.apache.s4:s4-base:0.5.0-SNAPSHOT',
@@ -110,7 +110,7 @@
        'S4-Version': s4Version
        )
 
-appDependencies = ( configurations.compile )
+project.ext["appDependencies"] = ( configurations.compile )
 
 /* This task will extract all the class files and create a fat jar. We set the manifest and the extension to make it an S4 archive file. */
 // TODO: exclude schenma files as needed (not critical) see: http://forums.gradle.org/gradle/topics/using_gradle_to_fat_jar_a_spring_project
@@ -177,7 +177,8 @@
 */
 def getAppClassname(file) {
    def classname = "UNKNOWN"
-   lines= file.readLines()
+   def lines= file.readLines()
+   def packageName = ""
    for(line in lines) {
 
        def pn = line =~ /.*package\s+([\w\.]+)\s*;.*/
diff --git a/test-apps/twitter-counter/build.gradle b/test-apps/twitter-counter/build.gradle
index 4b7f6ff..6fd625d 100644
--- a/test-apps/twitter-counter/build.gradle
+++ b/test-apps/twitter-counter/build.gradle
@@ -34,13 +34,13 @@
 /* Set the destination where we want to install the apps. */
 //s4AppInstallDir = "/tmp/s4Apps" // TODO: decide how to standarize dirs, use env var?
 
-s4AppInstallDir = hasProperty('appsDir') ? "$appsDir" : "/tmp/appsDir"
+project.ext["s4AppInstallDir"] = hasProperty('appsDir') ? "$appsDir" : "/tmp/appsDir"
 
-s4Version = '0.5.0-SNAPSHOT'
+project.ext["s4Version"] = '0.5.0-SNAPSHOT'
 description = 'Apache S4 App'
 //defaultTasks 'installS4R'
-archivesBaseName = "$project.name"
-distRootFolder = "$archivesBaseName-${-> version}"
+project.ext["archivesBaseName"] = "$project.name"
+project.ext["distRootFolder"] = "$archivesBaseName-${-> version}"
 
 
 // Append the suffix 'SNAPSHOT' when the build is not for release.
@@ -61,7 +61,7 @@
 repositories {
     mavenLocal()
     mavenCentral()
-    mavenRepo name: "gson", urls: "http://google-gson.googlecode.com/svn/mavenrepo"
+    mavenRepo name: "gson", url: "http://google-gson.googlecode.com/svn/mavenrepo"
 
     /* Add lib dir as a repo. Some jar files that are not available
      in a public repo are distributed in the lib dir. */
@@ -69,7 +69,7 @@
 }
 
 /* All project libraries must be defined here. */
-libraries = [
+project.ext["libraries"] = [
 
            s4_base:            'org.apache.s4:s4-base:0.5.0-SNAPSHOT',
            s4_comm:            'org.apache.s4:s4-comm:0.5.0-SNAPSHOT',
@@ -106,7 +106,7 @@
        'S4-Version': s4Version
        )
 
-appDependencies = ( configurations.compile )
+project.ext["appDependencies"] = ( configurations.compile )
 
 /* This task will extract all the class files and create a fat jar. We set the manifest and the extension to make it an S4 archive file. */
 // TODO: exclude schenma files as needed (not critical) see: http://forums.gradle.org/gradle/topics/using_gradle_to_fat_jar_a_spring_project
@@ -169,7 +169,8 @@
 */
 def getAppClassname(file) {
    def classname = "UNKNOWN"
-   lines= file.readLines()
+   def lines= file.readLines()
+   def packageName = ""
    for(line in lines) {
 
        def pn = line =~ /.*package\s+([\w\.]+)\s*;.*/
diff --git a/test-apps/twitter-counter/src/main/java/org/apache/s4/example/twitter/TopicExtractorPE.java b/test-apps/twitter-counter/src/main/java/org/apache/s4/example/twitter/TopicExtractorPE.java
index 946e3c9..9211583 100644
--- a/test-apps/twitter-counter/src/main/java/org/apache/s4/example/twitter/TopicExtractorPE.java
+++ b/test-apps/twitter-counter/src/main/java/org/apache/s4/example/twitter/TopicExtractorPE.java
@@ -34,13 +34,19 @@
     public void onEvent(Event event) {
         String text = event.get("statusText", String.class);
         logger.trace("event text [{}]", text);
-        if (text.contains("#")) {
-            Iterable<String> split = Splitter.on("#").omitEmptyStrings().trimResults()
-                    .split(text.substring(text.indexOf("#") + 1, text.length()));
-            for (String topic : split) {
-                String topicOnly = topic.split(" ")[0];
-                downStream.put(new TopicEvent(topicOnly, 1));
+        if (!text.contains("#")) {
+            return;
+        }
+        Iterable<String> split = Splitter.on(' ').omitEmptyStrings().trimResults().split(text);
+        for (String topic : split) {
+            if (!topic.startsWith("#")) {
+                continue;
             }
+            String topicOnly = topic.substring(1);
+            if (topicOnly.length() == 0 || topicOnly.contains("#")) {
+                continue;
+            }
+            downStream.put(new TopicEvent(topicOnly, 1));
         }
     }