summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2008-09-15 15:31:30 -0400
committerDwight <dmerriman@gmail.com>2008-09-15 15:31:30 -0400
commit6f3628d022ec6406d1aa5cea3bba10ce118891ab (patch)
tree4784ed25da1442aabde8b2257d7ec4c462a30610
parent379a7562629ff0803cfb30e0abfcddcbee046a19 (diff)
parentdb91183962d36d596157837a928217c411b84a7e (diff)
downloadmongo-r0.1.3_rc1.tar.gz
Merge branch 'master' of ssh://git.10gen.com/data/gitroot/pr0.1.3_rc1
-rw-r--r--.gitignore4
-rw-r--r--db/javajs.cpp50
2 files changed, 31 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index 42a889128fe..9fb5bf5de40 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,4 +10,6 @@
*.pch
db/Debug
db/db
-log \ No newline at end of file
+db/oplog*
+db/.gdb*
+log
diff --git a/db/javajs.cpp b/db/javajs.cpp
index 9d4d558731b..dc9b6b38ab2 100644
--- a/db/javajs.cpp
+++ b/db/javajs.cpp
@@ -79,6 +79,26 @@ JavaJSImpl::JavaJSImpl() {
JavaJSImpl(null);
}
+#if defined(_WIN32)
+const char SYSTEM_COLON = ';';
+#else
+const char SYSTEM_COLON = ':';
+#endif
+
+
+void _addClassPath( const char * ed , stringstream & ss , const char * subdir ){
+ path includeDir(ed);
+ includeDir /= subdir;
+ directory_iterator end;
+ directory_iterator i(includeDir);
+ while( i != end ) {
+ path p = *i;
+ ss << SYSTEM_COLON << p.string();
+ i++;
+ }
+}
+
+
JavaJSImpl::JavaJSImpl(const char *appserverPath){
_jvm = 0;
_mainEnv = 0;
@@ -87,35 +107,21 @@ JavaJSImpl::JavaJSImpl(const char *appserverPath){
const char * ed = findEd(appserverPath);
stringstream ss;
-#if defined(_WIN32)
- char colon = ';';
-#else
- char colon = ':';
-#endif
-
ss << "-Djava.class.path=.";
- ss << colon << ed << "/build/";
-
- {
- path includeDir(ed);
- includeDir /= "include";
- directory_iterator end;
- directory_iterator i(includeDir);
- while( i != end ) {
- path p = *i;
- ss << colon << p.string();
- i++;
- }
- }
+ ss << SYSTEM_COLON << ed << "/build/";
+
+ _addClassPath( ed , ss , "include" );
+ _addClassPath( ed , ss , "include/jython/" );
+ _addClassPath( ed , ss , "include/jython/javalib" );
#if defined(_WIN32)
- ss << colon << "C:\\Program Files\\Java\\jdk\\lib\\tools.jar";
+ ss << SYSTEM_COLON << "C:\\Program Files\\Java\\jdk\\lib\\tools.jar";
#else
- ss << colon << "/opt/java/lib/tools.jar";
+ ss << SYSTEM_COLON << "/opt/java/lib/tools.jar";
#endif
if( getenv( "CLASSPATH" ) )
- ss << colon << getenv( "CLASSPATH" );
+ ss << SYSTEM_COLON << getenv( "CLASSPATH" );
string s = ss.str();
char * p = (char *)malloc( s.size() * 4 );