Skip to content

Commit

Permalink
Filter using objects task attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
cubiccompass committed Nov 11, 2013
1 parent 0c14eba commit 2ef5e80
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ From the command line of any Salesforce development environment:
</target>

<target name="leapsfields">
<leap:leapsfields username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" />
<leap:leapsfields username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" objects="Lead,Contact,Account,Opportunity,Order__c" />
</target>

<target name="leaptriggers">
<leap:leaptriggers username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" />
<leap:leaptriggers username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" objects="Lead,Contact,Account,Opportunity,Order__c" />
</target>

<target name="leapwrappers">
<leap:leapwrappers username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" />
<leap:leapwrappers username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" objects="Lead,Contact,Account,Opportunity,Order__c" />
</target>
</project>
</pre>
6 changes: 3 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
</macrodef>

<target name="leapsfields">
<leap:leapsfields username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" />
<leap:leapsfields username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" objects="Lead,Contact,Account,Opportunity,Order__c" />
</target>

<target name="leaptriggers">
<leap:leaptriggers username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" />
<leap:leaptriggers username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" objects="Lead,Contact,Account,Opportunity,Order__c" />
</target>

<target name="leapwrappers">
<leap:leapwrappers username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" />
<leap:leapwrappers username="${sf.dev.username}" password="${sf.dev.password}" token="${sf.dev.token}" serverurl="${sf.dev.url}" objects="Lead,Contact,Account,Opportunity,Order__c" />
</target>

<target name="leapmetadiff">
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/leap/SFieldsTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ private String getSFieldEntries(){
String output = "";
Integer counter = 0;
for (int i = 0; i < this.sObjects().length; i++) {
//if(this.customOnly && this.sObjects()[i].isCustom()){ continue;}
if(!this.objects.equals("all") && !this.objectList().contains(sObjects()[i].getName())){
continue;
}
if(this.limit != -1 && counter++ > this.limit){ break;}

String object_name = "ALL_" + this.getFormattedObjectName(this.sObjects()[i]) + "_FIELDS";
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/leap/TriggerTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ public class TriggerTask extends LeapTask {
List<String> generatedFiles = new ArrayList<String>();

public void execute() {
System.out.println("Objects: " + this.objects);
for (int i = 0; i < this.sObjects().length; i++) {
if( !sObjects()[i].getTriggerable() || this.objectIsIgnored(sObjects()[i].getName()) ){
continue;
}
if(!this.objects.equals("all") && !this.objectList().contains(sObjects()[i].getName())){
continue;
}

try {
this.generateTriggerFile(this.sObjects()[i]);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/leap/WrapperTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public void execute() {
if( objectIsIgnored(sObjects()[i].getName()) ){
continue;
}

if(!this.objects.equals("all") && !this.objectList().contains(sObjects()[i].getName())){
continue;
}
try {
this.generateWrapperClass(this.sObjects()[i]);
this.generateTestFile(sObjects()[i]);
Expand Down

0 comments on commit 2ef5e80

Please sign in to comment.