Skip to content

Commit 733733a

Browse files
author
Andrew Lee
committed
Recursive Refractoring to make a unified semantic versioning system
-1.0.0/2.0.0/3.1.0 ~> 3.1.1 -Also, add a dist folder in the root to store all the plugins. Potential use is to symlink this folder into the plugins directory of Eclipse so that we no longer have to copy paste the plugin .jar files manually into the directory every time we modify the source files of java2script. (*Not sure if this works yet)
1 parent 5d3ca49 commit 733733a

File tree

93 files changed

+1764
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1764
-187
lines changed

demos/org.java2script.demo.gtalk/.j2s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Java2Script Configuration
22
#Sun Mar 18 22:29:00 CST 2007
3-
j2s.resources.list=../../plugins/net.sf.j2s.lib_1.0.0/j2slib/java.runtime.j2x,../../plugins/net.sf.j2s.lib_1.0.0/j2slib/swt.j2x,bin/org/java2script/demo/gtalk/GTalkRunnable.js,bin/org/java2script/demo/gtalk/AddFriendDialog.js,bin/org/java2script/demo/gtalk/AddFriendRunnable.js,bin/org/java2script/demo/gtalk/ChatDialog.js,bin/org/java2script/demo/gtalk/CloseChattingRunnable.js,bin/org/java2script/demo/gtalk/GoogleTalk.js,bin/org/java2script/demo/gtalk/JabberPool.js,bin/org/java2script/demo/gtalk/LoginRunnable.js,bin/org/java2script/demo/gtalk/LogoutRunnable.js,bin/org/java2script/demo/gtalk/ReceivingRunnable.js,bin/org/java2script/demo/gtalk/SendingRunnable.js,bin/org/java2script/demo/gtalk/UpdatingRunnable.js
3+
j2s.resources.list=../../plugins/net.sf.j2s.lib_3.1.1/j2slib/java.runtime.j2x,../../plugins/net.sf.j2s.lib_3.1.1/j2slib/swt.j2x,bin/org/java2script/demo/gtalk/GTalkRunnable.js,bin/org/java2script/demo/gtalk/AddFriendDialog.js,bin/org/java2script/demo/gtalk/AddFriendRunnable.js,bin/org/java2script/demo/gtalk/ChatDialog.js,bin/org/java2script/demo/gtalk/CloseChattingRunnable.js,bin/org/java2script/demo/gtalk/GoogleTalk.js,bin/org/java2script/demo/gtalk/JabberPool.js,bin/org/java2script/demo/gtalk/LoginRunnable.js,bin/org/java2script/demo/gtalk/LogoutRunnable.js,bin/org/java2script/demo/gtalk/ReceivingRunnable.js,bin/org/java2script/demo/gtalk/SendingRunnable.js,bin/org/java2script/demo/gtalk/UpdatingRunnable.js
44
j2s.abandoned.resources.list=
55
j2s.output.path=bin
66
j2s.compiler.status=enable

demos/org.java2script.demo.gtalk/org.java2script.demo.gtalk.GoogleTalk.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
<body>
3030
<!-- A Link An Application (ALAA) -->
3131
<div class="powered">Powered by <a href="http://j2s.sourceforge.net/">Java2Script</a></div>
32-
<a class="alaa" href="javascript:if(a='org.java2script.demo.gtalk.GoogleTalk@bin/',window['ClazzLoader']!=null)$w$(a);else{var d=document,t='onreadystatechange',x=d.createElement('SCRIPT'),f=function(){var s=this.readyState;if(s==null||s=='loaded'||s=='complete'){$w$(a);}};x.src='http://archive.java2script.org/1.0.0-m5/j2slib.z.js';(typeof x[t]=='undefined')?x.onload=f:x[t]=f;d.getElementsByTagName('HEAD')[0].appendChild(x);void(0);}">org.java2script.demo.gtalk.GoogleTalk</a>
32+
<a class="alaa" href="javascript:if(a='org.java2script.demo.gtalk.GoogleTalk@bin/',window['ClazzLoader']!=null)$w$(a);else{var d=document,t='onreadystatechange',x=d.createElement('SCRIPT'),f=function(){var s=this.readyState;if(s==null||s=='loaded'||s=='complete'){$w$(a);}};x.src='http://archive.java2script.org/3.1.1-m5/j2slib.z.js';(typeof x[t]=='undefined')?x.onload=f:x[t]=f;d.getElementsByTagName('HEAD')[0].appendChild(x);void(0);}">org.java2script.demo.gtalk.GoogleTalk</a>
3333

3434
<script type="text/javascript">
3535
window["j2s.lib"] = {
3636
base : "http://archive.java2script.org/",
37-
alias : "1.0.0-m5",
37+
alias : "3.1.1-m5",
3838
version : "20070315",
3939
/*forward : true,*/
4040
mode : "dailybuild",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: Java2Script AJAX Support
4+
Bundle-SymbolicName: net.sf.j2s.ajax; singleton:=true
5+
Bundle-Version: 3.1.1
6+
Bundle-Activator: net.sf.j2s.ajax.AjaxPlugin
7+
Bundle-Vendor: j2s.sourceforge.net
8+
Require-Bundle: org.eclipse.core.runtime,
9+
org.eclipse.swt,
10+
org.eclipse.jdt.core,
11+
org.eclipse.core.resources,
12+
org.eclipse.core.variables,
13+
org.eclipse.jface
14+
Export-Package: net.sf.j2s.ajax
15+
Eclipse-LazyStart: true
16+
Bundle-ClassPath: ajaxlib.jar
19.4 KB
Binary file not shown.
Binary file not shown.
3.6 KB
Binary file not shown.
Binary file not shown.
48.7 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13.6 KB
Binary file not shown.
Binary file not shown.
145 KB
Binary file not shown.
Binary file not shown.
7.66 KB
Binary file not shown.
8.91 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?eclipse version="3.0"?>
3+
<plugin>
4+
<extension
5+
point="org.eclipse.jdt.core.classpathVariableInitializer">
6+
<classpathVariableInitializer
7+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
8+
variable="AJAX_CORE"/>
9+
<classpathVariableInitializer
10+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
11+
variable="AJAX_SWT"/>
12+
<classpathVariableInitializer
13+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
14+
variable="AJAX_RPC"/>
15+
<classpathVariableInitializer
16+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
17+
variable="AJAX_PIPE"/>
18+
<classpathVariableInitializer
19+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
20+
variable="AJAX_STORE"/>
21+
<classpathVariableInitializer
22+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
23+
variable="J2S_ANNOTATION"/>
24+
<classpathVariableInitializer
25+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
26+
variable="AJAX_CORE_SRC"/>
27+
<classpathVariableInitializer
28+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
29+
variable="AJAX_SWT_SRC"/>
30+
<classpathVariableInitializer
31+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
32+
variable="AJAX_RPC_SRC"/>
33+
<classpathVariableInitializer
34+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
35+
variable="AJAX_PIPE_SRC"/>
36+
<classpathVariableInitializer
37+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
38+
variable="AJAX_STORE_SRC"/>
39+
<classpathVariableInitializer
40+
class="net.sf.j2s.ajax.AJAXVariableInitializer"
41+
variable="J2S_ANNOTATION_SRC"/>
42+
</extension>
43+
44+
</plugin>
445 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: Java2Script Library
4+
Bundle-SymbolicName: net.sf.j2s.lib; singleton:=true
5+
Bundle-Version: 3.1.1
6+
Bundle-Activator: net.sf.j2s.lib.LibPlugin
7+
Bundle-Localization: plugin
8+
Require-Bundle: org.eclipse.core.runtime,
9+
net.sf.j2s.ui
10+
Eclipse-AutoStart: true
11+
Bundle-Vendor: j2s.sourceforge.net
12+
Bundle-ClassPath: library.jar
27 KB
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?eclipse version="3.0"?>
3+
<plugin>
4+
<extension
5+
id="net.sf.j2s.innerjsresources"
6+
name="Inner JS Resources"
7+
point="net.sf.j2s.ui.externalResourceProvider">
8+
<externalResourceProvider
9+
class="net.sf.j2s.lib.providers.JavaRuntimeJSProvider"
10+
id="net.sf.j2s.lib.providers.javaRuntimeJS"/>
11+
<!--
12+
<externalResourceProvider
13+
class="net.sf.j2s.lib.providers.JavaSWTJSProvider"
14+
id="net.sf.j2s.lib.providers.javaSWTJS"/>
15+
-->
16+
</extension>
17+
18+
</plugin>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package net.sf.j2s.lib;
2+
3+
import org.eclipse.core.runtime.Plugin;
4+
import org.osgi.framework.BundleContext;
5+
6+
/**
7+
* The main plugin class to be used in the desktop.
8+
*/
9+
public class LibPlugin extends Plugin {
10+
11+
//The shared instance.
12+
private static LibPlugin plugin;
13+
14+
/**
15+
* The constructor.
16+
*/
17+
public LibPlugin() {
18+
plugin = this;
19+
}
20+
21+
/**
22+
* This method is called upon plug-in activation
23+
*/
24+
public void start(BundleContext context) throws Exception {
25+
super.start(context);
26+
}
27+
28+
/**
29+
* This method is called when the plug-in is stopped
30+
*/
31+
public void stop(BundleContext context) throws Exception {
32+
super.stop(context);
33+
plugin = null;
34+
}
35+
36+
/**
37+
* Returns the shared instance.
38+
*/
39+
public static LibPlugin getDefault() {
40+
return plugin;
41+
}
42+
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2007 java2script.org and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Zhou Renjian - initial API and implementation
10+
*******************************************************************************/
11+
12+
package net.sf.j2s.lib.build;
13+
14+
import java.io.File;
15+
import java.io.FileInputStream;
16+
import java.io.FileNotFoundException;
17+
import java.io.FileOutputStream;
18+
import java.io.IOException;
19+
20+
/**
21+
* @author zhou renjian
22+
*
23+
* 2006-5-3
24+
*/
25+
public class Bundle2StringUtil {
26+
27+
/**
28+
* @param args
29+
* @throws FileNotFoundException
30+
*/
31+
public static void main(String[] args) throws FileNotFoundException {
32+
String bundleName = null;
33+
String basePath = "bin/";
34+
if (args.length != 0) {
35+
basePath = args[0];
36+
bundleName = args[1];
37+
} else {
38+
bundleName = "net.sf.j2s.java.core.messages";
39+
}
40+
String bundlePath = bundleName.replaceAll("\\.", "/") + ".properties";
41+
String content = RegExCompress.readFileAll(new FileInputStream(
42+
new File(basePath, bundlePath)));
43+
String contentStr = content
44+
.replaceAll("\\s*#.*[\\r\\n]+", "")
45+
.replaceAll("\\\\", "\\\\\\\\").replaceAll(
46+
"\\t", "\\\\t").replaceAll("\\r", "\\\\r").replaceAll("\\n",
47+
"\\\\n").replaceAll("\\'", "\\\\'")
48+
.replaceAll("\\\"", "\\\\\"");
49+
String jsStr = "java.util.ResourceBundle.registerBundle(\""
50+
+ bundleName + "\", \"" + contentStr + "\");";
51+
System.out.println(jsStr);
52+
if (args.length != 0) {
53+
try {
54+
bundlePath = bundleName.replaceAll("\\.", "/") + ".js";
55+
FileOutputStream fos = new FileOutputStream(new File(basePath,
56+
bundlePath));
57+
fos.write(jsStr.getBytes());
58+
fos.close();
59+
} catch (IOException e) {
60+
e.printStackTrace();
61+
}
62+
}
63+
}
64+
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2007 java2script.org and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Zhou Renjian - initial API and implementation
10+
*******************************************************************************/
11+
12+
package net.sf.j2s.lib.build;
13+
14+
import java.io.File;
15+
import java.io.FileInputStream;
16+
import java.io.FileNotFoundException;
17+
import java.io.FileOutputStream;
18+
import java.io.IOException;
19+
20+
/**
21+
* @author zhou renjian
22+
*
23+
* 2006-7-29
24+
*/
25+
public class J2SConcat {
26+
/**
27+
* @param args
28+
*/
29+
public static void main(String[] args) {
30+
boolean completelyCompressing = true;
31+
int indexDelta = 1;
32+
if (args.length > 0 && ("true".equals(args[0]) || "false".equals(args[0]))) {
33+
completelyCompressing = "true".equals(args[0]);
34+
indexDelta++;
35+
}
36+
File dest = new File(args[indexDelta - 1]);
37+
StringBuffer buf = new StringBuffer();
38+
String j2sKeySig = "/* http://j2s.sf.net/ */";
39+
buf.append(j2sKeySig);
40+
System.out.println("To " + dest.getAbsolutePath());
41+
boolean isAllFileEarlier = dest.exists();
42+
if (isAllFileEarlier) {
43+
for (int i = 0; i < args.length - 1 - indexDelta; i++) {
44+
File src = new File(args[indexDelta], args[i + 1 + indexDelta]);
45+
if (!src.exists()) {
46+
System.err.println("Source file " + src.getAbsolutePath() + " does not exist!");
47+
return ;
48+
}
49+
// System.out.println("Checking " + args[i + 1 + indexDelta] + " ...");
50+
if (src.lastModified() > dest.lastModified()) {
51+
isAllFileEarlier = false;
52+
break;
53+
}
54+
}
55+
if (isAllFileEarlier) {
56+
System.out.println("Already updated.");
57+
return;
58+
}
59+
}
60+
for (int i = 0; i < args.length - 1 - indexDelta; i++) {
61+
File src = new File(args[indexDelta], args[i + 1 + indexDelta]);
62+
try {
63+
String s = RegExCompress.readFileAll(new FileInputStream(src));
64+
if (s.startsWith(j2sKeySig)) {
65+
s = s.substring(j2sKeySig.length());
66+
}
67+
if (s.startsWith("Clazz.load") || s.startsWith("$_L")) {
68+
int idx1 = s.indexOf("{") + 1;
69+
if (idx1 != -1) {
70+
int idx2 = s.lastIndexOf("}");
71+
if (idx2 != -1) {
72+
s = s.substring(idx1, idx2);
73+
}
74+
}
75+
}
76+
/*
77+
if (completelyCompressing) {
78+
buf.append(RegExCompress.regexCompress(s));
79+
} else {
80+
buf.append(RegExCompress.regexCompress2(s));
81+
}
82+
*/
83+
buf.append(s);
84+
} catch (FileNotFoundException e) {
85+
e.printStackTrace();
86+
return;
87+
}
88+
}
89+
try {
90+
FileOutputStream fos = new FileOutputStream(dest);
91+
fos.write(new byte[] {(byte) 0xef, (byte) 0xbb, (byte) 0xbf}); // UTF-8 header!
92+
if (completelyCompressing) {
93+
fos.write(RegExCompress.regexCompress(buf.toString()).getBytes("UTF-8"));
94+
} else {
95+
fos.write(RegExCompress.regexCompress2(buf.toString()).getBytes("UTF-8"));
96+
}
97+
fos.close();
98+
} catch (IOException e) {
99+
e.printStackTrace();
100+
}
101+
102+
}
103+
}

0 commit comments

Comments
 (0)