cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [47/50] [abbrv] git commit: CB-5715 Add Eclipse .project file to create template.
Date Wed, 22 Jan 2014 19:38:58 GMT
CB-5715 Add Eclipse .project file to create template.

Adds resource filter to hide CordovaLib/, platform_www/, and cordova/.
Adds linked resources to root www/, merges/, config.xml


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/70ce1117
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/70ce1117
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/70ce1117

Branch: refs/heads/master
Commit: 70ce111759f7bb0d692772809a0c5c4d2cc5ca3f
Parents: 4963927
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu Jan 2 16:40:48 2014 -0500
Committer: Joe Bowser <bowserj@apache.org>
Committed: Wed Jan 22 11:37:23 2014 -0800

----------------------------------------------------------------------
 bin/create                                |  1 +
 bin/lib/create.js                         |  9 +++-
 bin/templates/project/eclipse-project     | 45 +++++++++++++++++
 bin/templates/project/eclipse-project-CLI | 67 ++++++++++++++++++++++++++
 4 files changed, 121 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/70ce1117/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index 9ab6689..455ba30 100755
--- a/bin/create
+++ b/bin/create
@@ -37,3 +37,4 @@ if(args.length < 3 || (args[2] == '--help' || args[2] == '/?' || args[2]
== '-h'
     });
 }
 
+create.createProject(args._[0], args._[1], args._[2], args._[3], args['--shared'], args['--cli']).done();

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/70ce1117/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index c482b5a..c542ab8 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -105,7 +105,7 @@ function copyScripts(projectPath) {
  * Returns a promise.
  */
 
-exports.createProject = function(project_path, package_name, project_name, project_template_dir)
{
+exports.createProject = function(project_path, package_name, project_name, project_template_dir,
use_shared_project, use_cli_template) {
     var VERSION = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8').trim();
 
     // Set default values for path, package and name
@@ -154,6 +154,12 @@ exports.createProject = function(project_path, package_name, project_name,
proje
             shell.cp('-r', path.join(project_template_dir, 'res'), project_path);
             // Manually create directories that would be empty within the template (since
git doesn't track directories).
             shell.mkdir(path.join(project_path, 'libs'));
+            // Add in the proper eclipse project file.
+            if (use_cli_template) {
+                shell.cp(path.join(project_template_dir, 'eclipse-project-CLI'), path.join(project_path,
'.project'));
+            } else {
+                shell.cp(path.join(project_template_dir, 'eclipse-project'), path.join(project_path,
'.project'));
+            }
 
             // copy cordova.js, cordova.jar and res/xml
             shell.cp('-r', path.join(ROOT, 'framework', 'res', 'xml'), path.join(project_path,
'res'));
@@ -164,6 +170,7 @@ exports.createProject = function(project_path, package_name, project_name,
proje
             shell.cp('-f', path.join(project_template_dir, 'Activity.java'), activity_path);
             shell.sed('-i', /__ACTIVITY__/, safe_activity_name, activity_path);
             shell.sed('-i', /__NAME__/, project_name, path.join(project_path, 'res', 'values',
'strings.xml'));
+            shell.sed('-i', /__NAME__/, project_name, path.join(project_path, '.project'));
             shell.sed('-i', /__ID__/, package_name, activity_path);
 
             shell.cp('-f', path.join(project_template_dir, 'AndroidManifest.xml'), manifest_path);

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/70ce1117/bin/templates/project/eclipse-project
----------------------------------------------------------------------
diff --git a/bin/templates/project/eclipse-project b/bin/templates/project/eclipse-project
new file mode 100644
index 0000000..42bcc3e
--- /dev/null
+++ b/bin/templates/project/eclipse-project
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>__NAME__</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+	<filteredResources>
+		<filter>
+			<id>1388696068187</id>
+			<name></name>
+			<type>10</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-true-CordovaLib|platform_www|cordova</arguments>
+			</matcher>
+		</filter>
+	</filteredResources>
+</projectDescription>
+

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/70ce1117/bin/templates/project/eclipse-project-CLI
----------------------------------------------------------------------
diff --git a/bin/templates/project/eclipse-project-CLI b/bin/templates/project/eclipse-project-CLI
new file mode 100644
index 0000000..5772dec
--- /dev/null
+++ b/bin/templates/project/eclipse-project-CLI
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>__NAME__</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>** Cordova Project **</name>
+			<type>2</type>
+			<locationURI>virtual:/virtual</locationURI>
+		</link>
+		<link>
+                        <name>** Cordova Project **/config.xml</name>
+			<type>1</type>
+			<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/www/config.xml</locationURI>
+		</link>
+                <link>
+                        <name>** Cordova Project **/www</name>
+                        <type>2</type>
+			<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/www</locationURI>
+                </link>
+                <link>
+                        <name>** Cordova Project **/merges</name>
+                        <type>2</type>
+			<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/merges</locationURI>
+                </link>
+	</linkedResources>
+	<filteredResources>
+		<filter>
+			<id>1388696068187</id>
+			<name></name>
+			<type>10</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-true-CordovaLib|platform_www|cordova</arguments>
+			</matcher>
+		</filter>
+	</filteredResources>
+</projectDescription>
+


Mime
View raw message