import java.io.IOException;
import java.text.MessageFormat;
+import java.util.ArrayList;
import java.util.List;
import org.apache.commons.cli.CommandLine;
import static org.tizen.cli.exec.LaunchOptionConstants.DESC_INCLUDE;
import static org.tizen.cli.exec.LaunchOptionConstants.OPT_EXCLUDE;
import static org.tizen.cli.exec.LaunchOptionConstants.DESC_EXCLUDE;
+import static org.tizen.cli.exec.LaunchOptionConstants.OPT_DEVELOP;
+import static org.tizen.cli.exec.LaunchOptionConstants.DESC_DEVELOP_PROFILE;
import org.tizen.cli.exec.AbstractLauncher;
import org.tizen.cli.exec.Help;
import org.tizen.common.file.FileHandler.Attribute;
import org.tizen.common.sign.command.ReadSigningProfileFileCommand;
import org.tizen.common.sign.command.SignCommand;
+import org.tizen.common.sign.preferences.SigningProfileItem;
+import org.tizen.common.sign.util.SigningProfileUtil;
import org.tizen.common.util.CollectionUtil;
import org.tizen.common.util.FilenameUtil;
opts.addOption( OptionBuilder.hasArg().withLongOpt( OPT_EXCLUDE ).withDescription( DESC_EXCLUDE ).create( OPT_EXCLUDE.substring( 0, 1 ) ) );
opts.addOption( OptionBuilder.hasArg().withLongOpt( OPT_PROFILE ).withDescription( DESC_PROFILE ).create( OPT_PROFILE.substring( 0, 1 ) ) );
+ opts.addOption( OptionBuilder.withLongOpt( OPT_DEVELOP ).withDescription( DESC_DEVELOP_PROFILE ).create( OPT_DEVELOP.substring( 0, 1 ) ) );
return opts;
}
return ;
}
+ List<SigningProfileItem> profileItems = new ArrayList<SigningProfileItem>();
+
+ if ( cmdLine.hasOption( OPT_DEVELOP ) ) {
+ // Always add a developer certificate first because must be "signature1.xml"
+ profileItems.add( SigningProfileUtil.createDeveloperItem() );
+ }
+
final ReadSigningProfileFileCommand readProfile = new ReadSigningProfileFileCommand( profilesFilePath, profileName );
getExecutor().execute( readProfile );
logger.info( "Profiles file[{}] is read", profilesFilePath );
return ;
}
- final SignCommand command = new SignCommand( baseDir, profileName, readProfile.getProfileItems() );
+ profileItems.addAll( readProfile.getProfileItems() );
+
+ final SignCommand command = new SignCommand( baseDir, profileName, profileItems );
command.setIncludes( includes );
command.setExcludes( excludes );
getExecutor().execute( command );