package org.tizen.cli.exec.pack;
import java.io.File;
-
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.tizen.common.core.command.CommandCancelException;
import org.tizen.common.core.command.Executor;
+import org.tizen.common.util.FileUtil;
import org.tizen.nativecommon.IXMLStore;
import org.tizen.nativecommon.build.AbstractMultiPackager;
import org.tizen.nativecpp.misc.core.NewAppXmlStore;
private static final String BIN_FOLDER_NAME = "CommandLineBuild";
private String rootPrjPath;
private String[] refPrjPath;
+ private Logger logger = LoggerFactory.getLogger(CLIMultiPackager.class);
CLIMultiPackager(String rootPrjPath, String[] refPrjPath, Executor executor) {
@Override
protected boolean validateMultiPackage() {
File manifestFile = new File(rootPrjPath, ManifestXmlFile.MANIFEST_XML_FILE_NAME);
- if(manifestFile.exists() || (refPrjPath != null && refPrjPath.length > 0)) {
- return true;
+ if(!manifestFile.exists() || refPrjPath == null || refPrjPath.length < 1) {
+ return false;
+ }
+
+ for(String refPath: refPrjPath) {
+ String refPrjBinaryFolder = FileUtil.appendPath(refPath, getBinaryFolder());
+
+ if(refPath.endsWith("/") || refPath.endsWith("\\")) {
+ refPath = refPath.substring(0, refPath.length() - 1);
+ }
+
+ String refBinaryName = FileUtil.getFileNameFromPath(refPath) + EXT_BINARY_EXECUTABLE;
+ String refBinaryPath = FileUtil.appendPath(refPrjBinaryFolder, refBinaryName);
+
+ if(!new File(refBinaryPath).exists()) {
+ logger.error(String.format("Binary of %s does not exist.", refPath));
+ throw new CommandCancelException();
+ }
}
- return false;
+ return true;
}
@Override