Permalink
Browse files

merge

  • Loading branch information...
Eric Thorsen Eric Thorsen
Eric Thorsen authored and Eric Thorsen committed Jun 21, 2010
2 parents e960c43 + 852cd22 commit 797cc88799a6ad681fc723dfc356d3c66b9a9675
Showing with 502 additions and 130 deletions.
  1. +147 −89 netbeans/plugins/org-enclojure-plugin/pom.xml
  2. +103 −0 netbeans/plugins/org-enclojure-plugin/scripts/zip_projects.clj
  3. +2 −0 netbeans/plugins/org-enclojure-plugin/src/main/clojure/org/enclojure/ide/common/classpath_utils.clj
  4. +35 −14 netbeans/plugins/org-enclojure-plugin/src/main/java/org/enclojure/ide/nb/editor/layer.xml
  5. BIN ...emplate-1.1-distribution.zip → project/samples/ClojureProjectTemplate/ClojureProjectTemplate.zip}
  6. +0 −16 ...jure-plugin/src/main/resources/org/enclojure/ide/project/samples/RelevanceLabReplDescription.html
  7. BIN ...clojure-plugin/src/main/resources/org/enclojure/ide/templates/project/Clojure-1.1/Clojure-1.1.zip
  8. BIN .../main/resources/org/enclojure/ide/templates/project/Clojure-1.2-SNAPSHOT/Clojure-1.2-SNAPSHOT.zip
  9. BIN ...clojure-plugin/src/main/resources/org/enclojure/ide/templates/project/RelevanceLabReplProject.zip
  10. +2 −1 org-enclojure-commons/pom.xml
  11. +1 −1 org-enclojure-ide/pom.xml
  12. +1 −1 org-enclojure-repl-client/pom.xml
  13. +4 −2 org-enclojure-repl-client/src/main/clojure/org/enclojure/ide/repl/repl_manager.clj
  14. +1 −1 org-enclojure-repl-server/pom.xml
  15. +4 −4 pom.xml
  16. +1 −1 project.properties
  17. BIN templates/Clojure.1-1.zip
  18. +98 −0 templates/netbeans/ProjectTemplates/Clojure-1.1/pom.xml
  19. +103 −0 templates/netbeans/ProjectTemplates/Clojure-1.2-SNAPSHOT/pom.xml
  20. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/argfile.xml
  21. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/assembly.xml
  22. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/build.xml
  23. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/build/classes/default/core.clj
  24. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/clojure-build.xml
  25. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/manifest.mf
  26. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/nbproject/build-impl.xml
  27. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/nbproject/configs/jar.properties
  28. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/nbproject/genfiles.properties
  29. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/nbproject/private/private.xml
  30. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/nbproject/project.properties
  31. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/nbproject/project.xml
  32. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/pom.xml
  33. 0 templates/netbeans/{ → SampleProjects}/ClojureProjectTemplate/src/default/core.clj

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,103 @@
+(ns build.zip-projects
+ (:require
+ [clojure.contrib.duck-streams :as duck-streams]
+ [clojure.contrib.java-utils :as java-utils]
+ [org.enclojure.commons.c-slf4j :as logger]
+ [org.enclojure.repl.main :as repl.main]
+ )
+ (:import [java.util.zip ZipOutputStream ZipEntry]
+ [java.io File FileOutputStream FileInputStream]
+ [java.util.logging Logger Level]
+ [java.io PipedOutputStream PipedInputStream LineNumberReader InputStreamReader File]
+ [org.apache.commons.exec CommandLine ExecuteResultHandler
+ PumpStreamHandler DefaultExecutor ExecuteException ExecuteWatchdog]
+ ))
+
+; setup logging
+(logger/ensure-logger)
+
+(def *src-base-dir* (str (System/getProperty "user.dir")
+ "/../../../templates/netbeans"))
+(def *dest-base-dir* (str (System/getProperty "user.dir")
+ "/src/main/resources/org/enclojure/ide"))
+
+(def *src-project-templates-dir* (str *src-base-dir* "/ProjectTemplates"))
+(def *src-project-samples-dir* (str *src-base-dir* "/SampleProjects"))
+(def *filter-files* [".jar" "/private" ".class" "/classes"])
+
+(def *dest-project-templates-dir* (str *dest-base-dir* "/templates/project"))
+(def *dest-project-samples-dir* (str *dest-base-dir* "/project/samples"))
+
+(defn get-directories [path]
+ (filter #(.isDirectory %)
+ (vec (.listFiles (java-utils/file path)))))
+
+(defn process-completed [exit-value]
+ (println "Process terminated: {}" exit-value))
+
+(defn process-failed3 [out-fn err-fn #^ExecuteException ex]
+ (println (format "Process failed: %s %s" (.getMessage ex)
+ (if-let [c (.getCause ex)]
+ (.getMessage c)))))
+
+(defn monitor [stream read-fn]
+ (repl.main/start-io-thread
+ #(binding [*out* stream]
+ (let [msg (read-fn)]
+ (println "anything???")
+ (print msg)
+ (flush)))
+ (fn [cause]
+ (print "\nError in monitor\n"))))
+
+(defn setup-monitors [out-fn err-fn]
+ (monitor *out* out-fn)
+ (monitor *out* err-fn))
+
+(defn zip-dir [dest-zip-file src-dir]
+(let [cmd-line (CommandLine. "zip")
+ #^DefaultExecutor executor (DefaultExecutor.)
+ [out-pipe err-pipe] [(PipedOutputStream.) (PipedOutputStream.)]
+ out-pipe-reader (LineNumberReader.
+ (InputStreamReader. (PipedInputStream. out-pipe)))
+ err-pipe-reader (LineNumberReader.
+ (InputStreamReader. (PipedInputStream. err-pipe)))
+ stream-handler (PumpStreamHandler. out-pipe err-pipe)]
+ (doall (map #(.addArgument cmd-line % true) ["-R" (str dest-zip-file) "*"]))
+ (.setWorkingDirectory executor (if (instance? java.io.File src-dir)
+ src-dir (java.io.File. src-dir)))
+ (.setWatchdog executor (ExecuteWatchdog. Integer/MAX_VALUE))
+ (.execute executor cmd-line (proxy [ExecuteResultHandler] []
+ (onProcessComplete [exit-value]
+ (process-completed exit-value))
+ (onProcessFailed [ex]
+ (println ex)
+ (println (.getCause ex))
+ (process-failed3
+ #(.readLine out-pipe-reader)
+ #(.readLine err-pipe-reader)
+ ex))))))
+
+(defn zip-files [target-path
+ src-base-dir]
+ (let [name (.getName (java-utils/file src-base-dir))
+ full-target (File. (str target-path "/" name)
+ (str name ".zip"))]
+ (when (.exists full-target)
+ (.delete full-target))
+ (.mkdirs (java-utils/file (str target-path "/" name)))
+ (zip-dir full-target src-base-dir)))
+
+(defn zip-it [target-path src-base-dir]
+ (zip-files target-path src-base-dir))
+
+(defn zip-project-templates []
+ (doall (map #(zip-it *dest-project-templates-dir* %)
+ (get-directories *src-project-templates-dir*))))
+
+(defn zip-project-samples []
+ (doall (map #(zip-it *dest-project-samples-dir* %)
+ (get-directories *src-project-samples-dir*))))
+
+(zip-project-templates)
+(zip-project-samples)
@@ -302,6 +302,7 @@ use on a jvm startup."
"For a given project we want a map of:
{:source-roots :execute-paths}"
([#^Project p]
+ (logger/info "might be a sub-project call for " p)
(when p
(loop [sources (get-source-roots p) ret {}]
(if-let [source (first sources)]
@@ -340,6 +341,7 @@ in order to promote clojure finding the source and loading that before anything
(loop [sub-projects
(when-let [subpp (-> p .getLookup
(.lookup org.netbeans.spi.project.SubprojectProvider))]
+ (logger/info "Found subproject..............")
(.getSubprojects subpp))
cps {}]
(if-let [subp (first sub-projects)]
@@ -56,43 +56,43 @@
<file name="org-enclojure-ide-nb-actions-ChangeReplNamespaceAction.shadow">
<attr name="originalFile" stringvalue="Actions/Clojure/org-enclojure-ide-nb-actions-ChangeReplNamespaceAction.instance"/>
- <attr name="position" intvalue="1805"/>
+ <attr name="position" intvalue="1804"/>
</file>
<file name="org-enclojure-ide-nb-actions-UseFileNSInReplAction.shadow">
<attr name="originalFile" stringvalue="Actions/Clojure/org-enclojure-ide-nb-actions-UseFileNSInReplAction.instance"/>
- <attr name="position" intvalue="1806"/>
+ <attr name="position" intvalue="1805"/>
</file>
<file name="org-enclojure-nbmodule-separatorBefore.instance">
<attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
- <attr name="position" intvalue="1810"/>
+ <attr name="position" intvalue="1806"/>
</file>
<file name="org-enclojure-ide-nb-actions-GotoDeclaration.shadow">
<attr name="originalFile" stringvalue="Actions/Clojure/org-enclojure-ide-nb-actions-GotoDeclaration.instance"/>
- <attr name="position" intvalue="1811"/>
+ <attr name="position" intvalue="1807"/>
</file>
<file name="org-enclojure-ide-nb-editor-ClojureReindentAction.shadow">
<attr name="originalFile" stringvalue="Actions/Clojure/org-enclojure-ide-nb-editor-ClojureReindentAction.instance"/>
- <attr name="position" intvalue="1812"/>
+ <attr name="position" intvalue="1808"/>
</file>
<file name="org-enclojure-ide-nb-actions-ToggleComment.shadow">
<attr name="originalFile" stringvalue="Actions/Clojure/org-enclojure-ide-nb-actions-ToggleComment.instance"/>
- <attr name="position" intvalue="1813"/>
+ <attr name="position" intvalue="1809"/>
</file>
<file name="org-enclojure-ide-nb-actions-SelectTopExpr.shadow">
<attr name="originalFile" stringvalue="Actions/Clojure/org-enclojure-ide-nb-actions-SelectTopExpr.instance"/>
- <attr name="position" intvalue="1814"/>
+ <attr name="position" intvalue="1810"/>
</file>
<file name="org-enclojure-ide-nb-actions-SelectOuterExpr.shadow">
<attr name="originalFile" stringvalue="Actions/Clojure/org-enclojure-ide-nb-actions-SelectOuterExpr.instance"/>
- <attr name="position" intvalue="1815"/>
+ <attr name="position" intvalue="1811"/>
</file>
<file name="org-enclojure-ide-nb-actions-NavByExprOut.shadow">
<attr name="originalFile" stringvalue="Actions/Clojure/org-enclojure-ide-nb-actions-NavByExprOut.instance"/>
- <attr name="position" intvalue="1816"/>
+ <attr name="position" intvalue="1812"/>
</file>
<file name="org-enclojure-ide-nb-actions-NavByExprIn.shadow">
<attr name="originalFile" stringvalue="Actions/Clojure/org-enclojure-ide-nb-actions-NavByExprIn.instance"/>
- <attr name="position" intvalue="1817"/>
+ <attr name="position" intvalue="1813"/>
</file>
</folder>
@@ -411,7 +411,7 @@
</file>
<file name="org-enclojure-ide-nb-actions-EvalExpressionInReplAction.shadow">
<attr name="originalFile" stringvalue="Actions/Edit/org-enclojure-ide-nb-actions-EvalExpressionInReplAction.instance"/>
- <attr name="position" intvalue="9030"/>
+ <attr name="position" intvalue="9035"/>
</file>
<file name="org-enclojure-ide-nb-actions-NavByExprIn.shadow">
<attr name="originalFile" stringvalue="Actions/Edit/org-enclojure-ide-nb-actions-NavByExprIn.instance"/>
@@ -451,10 +451,11 @@
</file>
<file name="org-enclojure-ide-nb-actions-CreateStandaloneReplAction.shadow">
<attr name="originalFile" stringvalue="Actions/Clojure/org-enclojure-ide-nb-actions-CreateStandaloneReplAction.instance"/>
- <attr name="position" intvalue="-100"/>
+ <attr name="position" intvalue="100"/>
</file>
<file name="ReplAction.shadow">
<attr name="originalFile" stringvalue="Actions/Window/org-enclojure-ide-nb-editor-ReplAction.instance"/>
+ <attr name="position" intvalue="101"/>
</file>
</folder>
<folder name="Edit">
@@ -634,18 +635,38 @@
<attr name="SystemFileSystem.icon"
urlvalue="nbresloc:/org/enclojure/ide/nb/clojure/project/enclojure 16x16.png"/>
</file>
+ <file name="Clojure 1.1 Maven Project" url="nbresloc:/org/enclojure/ide/templates/project/Clojure-1.1/Clojure-1.1.zip">
+ <attr name="SystemFileSystem.localizingBundle" stringvalue="org.enclojure.ide.nb.editor.Bundle"/>
+ <attr name="instantiatingWizardURL"
+ urlvalue="nbresloc:/org/enclojure/ide/nb/clojure/project/ClojureTemplateDescription.html"/>
+ <attr name="instantiatingIterator"
+ methodvalue="org.enclojure.ide.nb.clojure.project.ClojureTemplateWizardIterator.createIterator"/>
+ <attr name="template" boolvalue="true"/>
+ <attr name="SystemFileSystem.icon"
+ urlvalue="nbresloc:/org/enclojure/ide/nb/clojure/project/enclojure 16x16.png"/>
+ </file>
+ <file name="Clojure 1.2-SNAPSHOT Maven Project" url="nbresloc:/org/enclojure/ide/templates/project/Clojure-1.2-SNAPSHOT/Clojure-1.2-SNAPSHOT.zip">
+ <attr name="SystemFileSystem.localizingBundle" stringvalue="org.enclojure.ide.nb.editor.Bundle"/>
+ <attr name="instantiatingWizardURL"
+ urlvalue="nbresloc:/org/enclojure/ide/nb/clojure/project/ClojureTemplateDescription.html"/>
+ <attr name="instantiatingIterator"
+ methodvalue="org.enclojure.ide.nb.clojure.project.ClojureTemplateWizardIterator.createIterator"/>
+ <attr name="template" boolvalue="true"/>
+ <attr name="SystemFileSystem.icon"
+ urlvalue="nbresloc:/org/enclojure/ide/nb/clojure/project/enclojure 16x16.png"/>
+ </file>
</folder>
<folder name="Samples">
<folder name="Clojure">
- <file name="Relevance LabRepl Project" url="nbresloc:/org/enclojure/ide/templates/project/RelevanceLabReplProject.zip">
+<!-- <file name="Relevance LabRepl Project" url="nbresloc:/org/enclojure/ide/templates/project/RelevanceLabReplProject.zip">
<attr name="displayName"
bundlevalue="org.enclojure.ide.project.samples.Bundle#Relevance.LabRepl.name"/>
<attr name="instantiatingIterator"
methodvalue="org.enclojure.ide.project.samples.RelevanceLabReplWizardIterator.createIterator"/>
<attr name="instantiatingWizardURL"
urlvalue="nbresloc:/org/enclojure/ide/project/samples/RelevanceLabReplDescription.html"/>
<attr name="template" boolvalue="true"/>
- </file>
+ </file>-->
</folder>
</folder>
</folder>
@@ -1,16 +0,0 @@
-<!--
-To change this template, choose Tools | Templates
-and open the template in the editor.
--->
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- </head>
- <body>
- <b>labrepl for Clojure</b><br />
- <i>Copyright (c) Relevance, Inc. All rights reserved.</i><br />
-The use and distribution terms for this software are covered by the Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license.
-<br />
-You must not remove this notice, or any other, from this software.
- </body>
-</html>
@@ -1,10 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.enclojure</groupId>
<artifactId>nb-enclojure-app</artifactId>
- <version>1.1</version>
+ <version>${enclojure.version.release}</version>
</parent>
<artifactId>org-enclojure-commons</artifactId>
<version>1.0-SNAPSHOT</version>
@@ -5,7 +5,7 @@
<parent>
<artifactId>nb-enclojure-app</artifactId>
<groupId>org.enclojure</groupId>
- <version>1.1</version>
+ <version>${enclojure.version.release}</version>
</parent>
<groupId>org.enclojure</groupId>
<artifactId>org-enclojure-ide</artifactId>
@@ -5,7 +5,7 @@
<parent>
<artifactId>nb-enclojure-app</artifactId>
<groupId>org.enclojure</groupId>
- <version>1.1</version>
+ <version>${enclojure.version.release}</version>
</parent>
<groupId>org.enclojure</groupId>
<artifactId>org-enclojure-repl-client</artifactId>
@@ -182,10 +182,12 @@ For seeing the command line use:"
out-pipe-reader (LineNumberReader.
(InputStreamReader. (PipedInputStream. out-pipe)))
err-pipe-reader (LineNumberReader.
- (InputStreamReader. (PipedInputStream. err-pipe)))]
+ (InputStreamReader. (PipedInputStream. err-pipe)))
+ stream-handler (PumpStreamHandler. out-pipe err-pipe)]
(.setWorkingDirectory executor (if (instance? java.io.File working-dir)
working-dir (java.io.File. working-dir)))
- (.setStreamHandler executor (PumpStreamHandler. out-pipe err-pipe))
+ (.setStreamHandler executor stream-handler)
+ (.start stream-handler)
(process-monitor-fn
#(.readLine out-pipe-reader)
#(.readLine err-pipe-reader))
@@ -5,7 +5,7 @@
<parent>
<artifactId>nb-enclojure-app</artifactId>
<groupId>org.enclojure</groupId>
- <version>1.1</version>
+ <version>${enclojure.version.release}</version>
</parent>
<groupId>org.enclojure</groupId>
<artifactId>org-enclojure-repl-server</artifactId>
View
@@ -2,8 +2,8 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http//www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<properties>
<clojure.version>1.1.0</clojure.version>
- <clojure.snaphot-name></clojure.snaphot-name>
- <clojure-contrib.snaphot-name></clojure-contrib.snaphot-name>
+ <clojure.snapshot.tag></clojure.snapshot.tag>
+ <clojure.contrib.snapshot.tag></clojure.contrib.snapshot.tag>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<netbeans.version>RELEASE68</netbeans.version>
<brandingToken>enclojure</brandingToken>
@@ -28,12 +28,12 @@
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
- <version>${clojure.version}${clojure.snaphot-name}</version>
+ <version>${clojure.version}${clojure.snapshot.tag}</version>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure-contrib</artifactId>
- <version>${clojure.version}${clojure-contrib.snaphot-name}</version>
+ <version>${clojure.version}${clojure.contrib.snapshot.tag}</version>
</dependency>
</dependencies>
<repositories>
View
@@ -1 +1 @@
-enclojure.version.release=1.4
+enclojure.version.release=1.4
View
Binary file not shown.
Oops, something went wrong.

0 comments on commit 797cc88

Please sign in to comment.