import org.tizen.nativecommon.templateengine.TizenTemplateEngine;
import org.tizen.nativecommon.templateengine.build.AbstractProjectGenerator;
import org.tizen.nativecommon.templateengine.build.model.BuildProperty;
+import org.tizen.nativecommon.templateengine.build.model.DevPackageModel;
+import org.tizen.nativecommon.templateengine.build.model.RootstrapModel;
import org.tizen.nativecommon.templateengine.build.model.TargetModel;
+import org.tizen.nativecommon.templateengine.build.model.ToolchainModel;
import org.tizen.nativecommon.templateengine.model.TizenTemplate;
import org.tizen.nativecommon.templateengine.process.TizenProcessRunner;
import org.tizen.nativecommon.templateengine.util.TemplateUtil;
private static final String MACRO_OBJS = "CLI_OBJ";
private static final String MACRO_DEPS = "CLI_DEPS";
private static final String MACRO_BINARY = "CLI_BINARY";
+ private static final String MACRO_PRJTYPE = "projectType";
+ private static final String MACRO_PLATFORM_VER = "platformVer";
+ private static final String MACRO_TOOLCHAIN = "tc";
private static final String WHITE_SPACE = " ";
private static final String WHITE_SPACE_IN_CLI = "\\ ";
public static final String DIR_MAKEFILE = InstallPathConfig.getSDKPath() + File.separatorChar + "tools" + File.separatorChar + "ide" + File.separatorChar + "template" + File.separatorChar +"makefile";
- private static final String DIR_ROOTSTRAP = InstallPathConfig.getPlatformVersionPath() + File.separatorChar + "rootstraps";
+ private static final String DIR_ROOTSTRAP = "$(ROOTSTRAP)";
+ private static final String DIR_SDK = "$(SDKPATH)";
+ private static final String DIR_DEFAULT_TC_CF = "$(TC_COMPILER_MISC)";
+ private static final String DIR_DEFAULT_RS_CF = "$(RS_COMPILER_MISC)";
+ private static final String DIR_DEFAULT_TC_LF = "$(TC_LINKER_MISC)";
+ private static final String DIR_DEFAULT_RS_LF = "$(RS_LINKER_MISC)";
+
+ public CLIProjectGenerator() {
+ super();
+ }
@Override
- public void addDefaultIncludePaths(TizenTemplate template, TargetModel target) {
- String projectPath = template.getProjectPath();
- String defaultIncPath = FileUtil.appendPath(projectPath, "inc", false);
- buildProperty.addIncludePath(getQuotedString(defaultIncPath));
-
- super.addDefaultIncludePaths(template, target);
+ protected String getSDKPath() {
+ return DIR_SDK;
}
-
+
+ @Override
+ protected String getDefaultCfTc(ToolchainModel target) {
+ return DIR_DEFAULT_TC_CF;
+ }
+
+ @Override
+ protected String getDefaultCfRs(RootstrapModel rootstrap) {
+ return DIR_DEFAULT_RS_CF;
+ }
+
+ @Override
+ protected String getDefaultLfTc(ToolchainModel toolchain) {
+ return DIR_DEFAULT_TC_LF;
+ }
+
+ @Override
+ protected String getDefaultLfRs(RootstrapModel rootstrap) {
+ return DIR_DEFAULT_RS_LF;
+ }
+
@Override
protected String getRootstrapPath(String rootstrapId) {
- //TODO It should be replaced to Macro.
- return DIR_ROOTSTRAP + File.separatorChar + rootstrapId;
+ return DIR_ROOTSTRAP;
}
-
+
@Override
protected String getQuotedString(String msg) {
return msg.replace(WHITE_SPACE, WHITE_SPACE_IN_CLI);
public void pressDefaultPostValueStore(Map<String, String> valueStore, TizenTemplate template) throws TizenProcessFailureException {
pressValueStoreForSrcObjDep(valueStore, template);
+ pressValueStoreForBuildData(valueStore, template);
String projectName = template.getProjectName();
String projectType = (String) template.getProperty(TizenTemplate.PROPERTY_KEY_PROJECTTYPE);
super.pressDefaultPostValueStore(valueStore, template);
}
+ private void pressValueStoreForBuildData(Map<String, String> valueStore, TizenTemplate template) {
+ valueStore.put(MACRO_PLATFORM_VER, (String) template.getProperty(MACRO_PLATFORM_VER));
+ valueStore.put(MACRO_PRJTYPE, (String) template.getProperty(MACRO_PRJTYPE));
+ valueStore.put(MACRO_TOOLCHAIN, (String) template.getProperty(MACRO_TOOLCHAIN));
+ }
+
private static void pressValueStoreForSrcObjDep(Map<String, String> valueStore, TizenTemplate template) {
String projectPath = FileUtil.appendPath(template.getProjectPath(), "src");
File projectDir = new File(projectPath);
runner.setTemplate(template);
return runner;
}
+
+ @Override
+ public void doRemainingJob(List<DevPackageModel> emulDevPackageModelList, TizenTemplate template, TargetModel target) {
+ ToolchainModel toolChain = target.getToolchain();
+ RootstrapModel rootstrap = target.getRootstrap();
+
+ String platformVer = rootstrap.getVersion();
+ String toolChainName = toolChain.getName();
+ String projectType = toolChain.getProjectType();
+ projectType = FileUtil.getFileExtension(projectType);
+
+ template.setProperty(MACRO_PLATFORM_VER, platformVer);
+ template.setProperty(MACRO_PRJTYPE, projectType);
+ template.setProperty(MACRO_TOOLCHAIN, toolChainName);
+ }
}