Files
cappuccino/Tools/nib2cib/Jakefile
T
Martin CarlbergandGitHub 1c866931f3 New: The compiler will now create warnings for variables that are never read (#2871)
This new warning adds a lot of warnings in the Cappuccino frameworks. I have turned off
the warning in the Jakefiles when compiling most of the Cappuccino frameworks. But it is
on as default for any user projects.

So there is also a new feature to turn off/on warnings as a compiler flag.

These flags are (all flags are on as default):
-Wunused-but-set-variable                    Warning when a local variable is never read.
-Wshadow-ivar                                Warning when a local variable is shadowing an instance variable for the class.
-Wcreate-global-inside-function-or-method    Warning when creating a global variable inside a function or method.
-Wunknown-class-or-global                    Warning when a class or global variable is not known.
-Wunknown-ivar-type                          Warning when the type for an instance variable is not known.

To turn off a flag add a 'no-' prefix. Example: -Wno-unused-but-set-variable

For an example how to use it in a Jakefile please look at the Jakefiles in this commit.
2020-02-21 14:29:48 +01:00

44 lines
1.4 KiB
JavaScript

require("../../common.jake");
var FILE = require("file");
var app = require("objective-j/jake").app;
var BundleTask = require("objective-j/jake").BundleTask;
app ("nib2cib", function(nib2cibTask)
{
nib2cibTask.setBuildIntermediatesPath(FILE.join($BUILD_DIR, "nib2cib.build", $CONFIGURATION))
nib2cibTask.setBuildPath($BUILD_CJS_CAPPUCCINO_LIB);
nib2cibTask.setIdentifier("com.280n.nib2cib");
nib2cibTask.setLicense(BundleTask.License.LGPL_v2_1);
nib2cibTask.setVersion(getCappuccinoVersion());
nib2cibTask.setAuthor("280 North, Inc.");
nib2cibTask.setEmail("feedback @nospam@ 280north.com");
nib2cibTask.setSummary("nib2cib converts Cocoa nib and xibs to Cappuccino cibs");
nib2cibTask.setSources(FILE.glob("**/*.j"));
nib2cibTask.setResources(FILE.glob("Resources/*"));
nib2cibTask.setEnvironments(require("objective-j/jake/environment").CommonJS);
nib2cibTask.setFlattensSources(true);
if ($CONFIGURATION === "Release")
nib2cibTask.setCompilerFlags("-O2 -Wno-unused-but-set-variable ");
else
nib2cibTask.setCompilerFlags("-DDEBUG -g -Wno-unused-but-set-variable ");
});
$BUILD_CJS_NIB2CIB = FILE.join($BUILD_CJS_CAPPUCCINO_BIN, 'nib2cib');
// executable in environment directory
filedir($BUILD_CJS_NIB2CIB, ["nib2cib"], function()
{
make_objj_executable($BUILD_CJS_NIB2CIB);
});
copyManPage("nib2cib", 1);
task ("build", ["nib2cib", $BUILD_CJS_NIB2CIB]);
CLOBBER.include($BUILD_CJS_NIB2CIB);