import org.eclipse.core.resources.IProject;
import org.tizen.common.core.application.InstallPathConfig;
-import org.tizen.common.core.application.ProfileInfo;
import org.tizen.common.core.application.TizenProjectDescription;
import org.tizen.common.core.application.tproject.TprojectHandler;
public abstract class AbstractTizenProject implements ITizenProject {
public TizenProjectDescription getDescription() {
+ return getDescription(true);
+ }
+
+ /**
+ * Returns the information of the tizen project.<br>
+ * Otherwise, returns null.<br>
+ *
+ * @param generate If the given generate is true and the information cannot be found,
+ * creates the information by using latest platform, and returns it.
+ */
+ public TizenProjectDescription getDescription(boolean generate) {
TprojectHandler handler = new TprojectHandler(getProject());
-
- return handler.unmarshal();
+ TizenProjectDescription desc = handler.unmarshal();
+ if ( desc != null ) {
+ return desc;
+ }
+ else {
+ if ( generate ) {
+ desc = new TizenProjectDescription(getProject());
+ desc.setPlatform(InstallPathConfig.getLatestProfileInfo());
+ if ( setDescription(desc) ) {
+ return desc;
+ }
+ else {
+ desc = null;
+ }
+ }
+ }
+ return desc;
}
public boolean setDescription( TizenProjectDescription desc ) {