logger.debug( "{} not cached", name );
template = realm.getTemplate( name );
}
- cache.put( name, template );
- template.template( models, storage );
- final String[] dependencies = CommonRealm.separate( template.getAttribute( TemplateConstants.ATTR_DEPENDENCY ) );
- if ( null == dependencies )
+ if ( null != template )
{
- continue;
+ cache.put( name, template );
+ template.template( models, storage );
+ final String[] dependencies = CommonRealm.separate( template.getAttribute( TemplateConstants.ATTR_DEPENDENCY ) );
+ if ( null == dependencies )
+ {
+ continue;
+ }
+
+ template( realm, dependencies, models, storage, cache );
}
-
- template( realm, dependencies, models, storage, cache );
}
}
import org.tizen.nativecpp.misc.core.NewAppXmlStore;
public class NativeMain extends AbstractLauncher {
-
private static final String PROJECTTYPE_APP = "app";
private static final String PROJECTTYPE_STATIC = "static";
private static final String PROJECTTYPE_SHARED = "shared";
private static final HashMap<String, String> SAMPLE_DIR_MAP = new HashMap<String, String>();
private static final HashMap<String, String> PROJECTTYPE_MAP = new HashMap<String, String>();
-
static {
SAMPLE_DIR_MAP.put(SAMPLE_EMPTY, SAMPLE_DIR_EMPTYPROJECT);
SAMPLE_DIR_MAP.put(SAMPLE_FORM, SAMPLE_DIR_FORM);
* @throws Exception If unhandled exception occur
*/
public static void main(String[] args) throws Exception {
-
final NativeMain instance = new NativeMain();
instance.run( args );
@Override
protected void execute(CommandLine cmdLine) throws Exception {
-
if(getInputCmd().equals(OPTION_CMD_MAKEFILE)) {
executeMakefile(cmdLine);
}
logger.trace("get user input");
String sampleName = cmdLine.getOptionValue(OPTION_SAMPLE);
-
String samplePath = InstallPathConfig.getSamplesPath();
String sampleDir = SAMPLE_DIR_MAP.get(sampleName);
no
);
- if ( no.equals( option ) )
- {
+ if(no.equals(option)) {
prompter.notify( Messages.getString("NativeMain.PROCESS_CANCEL") ); //$NON-NLS-1$
return ;
}
}
private void executeMakefile(CommandLine cmdLine) throws Exception {
-
Prompter prompter = getPrompter();
String projectType = cmdLine.getOptionValue(OPTION_MAKE_PROJECTTYPE);
}
TargetModel target = BuildPluginManagerForCLI.getDefaultTarget(projectId, BuildPluginUtil.ARCH_I386);
+ if(target == null) {
+ prompter.error("Build target is null.");
+ return;
+ }
+
RootstrapModel rootstrap = target.getRootstrap();
HashMap<String, DevPackageModel> devPkgMap = BuildPluginManagerForCLI.DEVPKG_MAP.get(rootstrap.getId());
-
ArrayList<DevPackageModel> devPkgList = new ArrayList<DevPackageModel>();
for(DevPackageModel devPkg: devPkgMap.values()) {
devPkgList.add(devPkg);
template.setProperty(TizenTemplate.PROPERTY_KEY_EMUL_BUILD_PROPERTY, buildProperty);
generator.doRemainingJob(devPkgList, template, target);
-
generator.pressDefaultPostValueStore(valueStore, template);
generator.pressPostValueStoreFromDevPkg(valueStore, template);
generator.createBuildFiles(valueStore, template);
@Override
protected Help createHelp() {
return new Help(getOptions(), getCommands(), getInputCmd(), getUsageDescription()) {
-
NativeMain outer = NativeMain.this;
private Help defaultHelp = new Help(outer.getSuperOptions(), outer.getCommands(), outer.getInputCmd(), outer.getUsageDescription());
}
return super.getHelp();
}
-
};
}
-}
\ No newline at end of file
+}
logger.trace( "install command");
exec.execute( install_command );
- String[] result = install_command.getResult().split("\\s+");
- int returnCode = Integer.parseInt(result[result.length-1]);
+ String[] result = install_command.getResult().split( "\\s+" );
+ int returnCode = Integer.parseInt( result[result.length-1] );
if (returnCode != 0) {
- ErrorMessageType type = ErrorMessageType.getErrorType(returnCode);
- prompter.notify(type.getManagement());
- exit(returnCode);
+ ErrorMessageType type = ErrorMessageType.getErrorType( returnCode );
+ prompter.notify( (type != null) ? type.getManagement() : null );
+ exit( returnCode );
}
}
uninstall_command.setTime( getTime() );
exec.execute( uninstall_command );
- String[] result = uninstall_command.getResult().split("\\s+");
- int returnCode = Integer.parseInt(result[result.length-1]);
+ String[] result = uninstall_command.getResult().split( "\\s+" );
+ int returnCode = Integer.parseInt( result[result.length-1] );
if (returnCode != 0) {
- ErrorMessageType type = ErrorMessageType.getErrorType(returnCode);
- prompter.notify(type.getManagement());
- exit(returnCode);
+ ErrorMessageType type = ErrorMessageType.getErrorType( returnCode );
+ prompter.notify( (type != null) ? type.getManagement() : null );
+ exit( returnCode );
}
}