Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
Add the type parameter to the force-org-create task
Browse files Browse the repository at this point in the history
  • Loading branch information
mcartoixa committed Feb 19, 2021
1 parent 4a91d69 commit 844f573
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/force-org-create.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ <h3>Parameters</h3>
<td>A username or alias for the target Dev Hub org.</td>
<td>No</td>
</tr>
<tr>
<td>type</td>
<td>-t</td>
<td>Specifies the type of org to create. Acceptable values are:
<ul>
<li><q>Scratch</q>: create a Scratch Org..</li>
<li><q>Sandbox</q>: create a Sandbox.</li>
</ul>
</td>
<td>No</td>
</tr>
<tr>
<td>wait</td>
<td>-w</td>
Expand Down
7 changes: 7 additions & 0 deletions src/main/com/mcartoixa/ant/sfdx/force/org/CreateTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Property;
import org.apache.tools.ant.types.Commandline;
Expand Down Expand Up @@ -121,6 +122,12 @@ public void setTargetDevHubUserName(final String devHubUserName) {
}
}

public void setType(final OrganizationType type) {
final Commandline.Argument arg = getCommandline().createArgument();
arg.setPrefix("-t");
arg.setValue(type.name().toLowerCase(Locale.ROOT));
}

public void setWait(final int timeout) {
if (timeout > 0) {
final Commandline.Argument arg = getCommandline().createArgument();
Expand Down
26 changes: 26 additions & 0 deletions src/main/com/mcartoixa/ant/sfdx/force/org/OrganizationType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2021 Mathieu Cartoixa.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mcartoixa.ant.sfdx.force.org;

/**
*
* @author Mathieu Cartoixa
*/
@SuppressWarnings("PMD.FieldNamingConventions")
public enum OrganizationType {
Scratch,
Sandbox
}

0 comments on commit 844f573

Please sign in to comment.