mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-29 09:52:03 +00:00
Fixed a few minor issues in steam.
Reviewed by me.
This commit is contained in:
1 parent
06601ba5df
commit
6f3a0bdc55
2 files changed
+43
-7
No files matched your search
+1
-1
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<key>Name</key>
|
||||
<string>AppKit</string>
|
||||
<key>Targets</key>
|
||||
<array>
|
||||
|
||||
+42
-6
@@ -89,6 +89,8 @@ function Project(/*String*/ aFilePath, /*String*/ aBuildPath)
|
||||
// Read the project file (its just a plist).
|
||||
this._properties = readPlist(this._file);
|
||||
|
||||
this._name = dictionary_getValue(this._properties, "Name");
|
||||
|
||||
// Read existing Info.plist if it exists.
|
||||
var infoPlist = new File(this._root.getAbsolutePath() + "/Info.plist");
|
||||
|
||||
@@ -125,6 +127,11 @@ function Project(/*String*/ aFilePath, /*String*/ aBuildPath)
|
||||
return this;
|
||||
}
|
||||
|
||||
Project.prototype.name = function()
|
||||
{
|
||||
return this._name;
|
||||
}
|
||||
|
||||
Project.prototype.targetWithName = function(/*String*/ aName)
|
||||
{
|
||||
var targets = this._targets,
|
||||
@@ -227,6 +234,10 @@ Project.prototype.activeFlags = function()
|
||||
|
||||
Project.prototype.build = function()
|
||||
{
|
||||
java.lang.System.out.println("Building Target \"" + this.activeTarget().name() +
|
||||
"\" of Project \"" + this.name() +
|
||||
"\" with Configuration \"" + this.activeConfiguration().name() + "\".");
|
||||
|
||||
var jFiles = getFiles(this._root, "j", this._activeTarget.exclusions()),
|
||||
replacedFiles = [];
|
||||
hasModifiedJFiles = false;
|
||||
@@ -298,6 +309,10 @@ Project.prototype.build = function()
|
||||
|
||||
Project.prototype.clean = function()
|
||||
{
|
||||
java.lang.System.out.println("Cleaning Target \"" + this.activeTarget().name() +
|
||||
"\" of Project \"" + this.name() +
|
||||
"\" with Configuration \"" + this.activeConfiguration().name() + "\".");
|
||||
|
||||
exec(["rm", "-rf", this.buildIntermediates().getAbsolutePath()], true);
|
||||
exec(["rm", "-rf", this.buildProducts().getAbsolutePath()], true);
|
||||
}
|
||||
@@ -565,11 +580,12 @@ function fileArrayContainsFile(/*Array*/ files, /*File*/ aFile)
|
||||
return false;
|
||||
}
|
||||
|
||||
function getFiles(/*File*/ sourceDirectory, /*String*/ extension, /*Array*/ exclusions)
|
||||
function getFiles(/*File*/ sourceDirectory, /*nil|String|Array<String>*/ extensions, /*Array*/ exclusions)
|
||||
{
|
||||
var matches = [],
|
||||
files = sourceDirectory.listFiles();
|
||||
|
||||
files = sourceDirectory.listFiles(),
|
||||
hasMultipleExtensions = typeof extensions !== "string";
|
||||
|
||||
if (files)
|
||||
{
|
||||
var index = 0,
|
||||
@@ -578,13 +594,33 @@ function getFiles(/*File*/ sourceDirectory, /*String*/ extension, /*Array*/ excl
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
var file = files[index].getCanonicalFile(),
|
||||
name = String(file.getName());
|
||||
name = String(file.getName()),
|
||||
isValidExtension = !extensions;
|
||||
|
||||
if ((!extension || name.substring(name.length - extension.length - 1) == ("." + extension)) && (!exclusions || !fileArrayContainsFile(exclusions, file)))
|
||||
if (exclusions && fileArrayContainsFile(exclusions, file))
|
||||
continue;
|
||||
|
||||
if (!isValidExtension)
|
||||
if (hasMultipleExtensions)
|
||||
{
|
||||
var extensionCount = extensions.length;
|
||||
|
||||
while (extensionCount-- && !isValidExtension)
|
||||
{
|
||||
var extension = extensions[extensionCount];
|
||||
|
||||
if (name.substring(name.length - extension.length - 1) === ("." + extension))
|
||||
isValidExtension = true;
|
||||
}
|
||||
}
|
||||
else if (name.substring(name.length - extensions.length - 1) === ("." + extensions))
|
||||
isValidExtension = true;
|
||||
|
||||
if (isValidExtension)
|
||||
matches.push(file);
|
||||
|
||||
if (file.isDirectory())
|
||||
matches = matches.concat(getFiles(file, extension, exclusions));
|
||||
matches = matches.concat(getFiles(file, extensions, exclusions));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user