Skip to content

Commit

Permalink
fixed issue for tracking fields and added logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Ruiz committed May 13, 2015
1 parent f517530 commit 5b04801
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dependencies {
}

group = 'org.fundacionjala.gradle.plugins.enforce'
version = '1.0.0'
version = '1.3.7'


uploadArchives {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ abstract class SalesforceTask extends ForceTask {
println("\tLogin type: ${credential.loginFormat}")
println("___________________________________________ ")
println AnsiColor.ANSI_RESET.value()
logger.debug('after show credentials')
}

/**
Expand Down Expand Up @@ -150,7 +151,9 @@ abstract class SalesforceTask extends ForceTask {
poll = project.enforce.poll
waitTime = project.enforce.waitTime
loadCredential()
logger.debug('Finished load credential')
fileManager.createDirectory(buildFolderPath)
logger.debug('Created directory at: ' + buildFolderPath)
runTask()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Deploy extends Deployment {
folderDeploy = Paths.get(buildFolderPath, FOLDER_DEPLOY).toString()
packagePathDeploy = Paths.get(folderDeploy, PACKAGE_NAME).toString()
createDeploymentDirectory(folderDeploy)
logger.debug('Created folder Deploy at: ' + folderDeploy)
if (Util.isValidProperty(project, FOLDERS_DEPLOY)) {
deployByFolder()
} else {
Expand Down Expand Up @@ -97,21 +98,26 @@ class Deploy extends Deployment {
def deployTruncateFiles() {
checkStatusTruncate()
displayFolderNoDeploy()
logger.debug('Displayed message')
if (codeTruncateOn) {
ArrayList<File> filesToTruncate = excludeFiles(fileManager.getFilesByFolders(projectPath, FOLDERS_TO_TRUNCATE))
Files.copy(Paths.get(projectPath, PACKAGE_NAME), Paths.get(packagePathDeploy), StandardCopyOption.REPLACE_EXISTING)
fileManager.copy(filesToTruncate, folderDeploy)
logger.debug('All files copied to deploy...')
writePackage(packagePathDeploy, filesToTruncate)
logger.debug('Created package...')
truncateComponents()
componentDeploy.startMessage = DEPLOYING_TRUNCATED_CODE
componentDeploy.successMessage = DEPLOYING_TRUNCATED_CODE_SUCCESSFULLY
executeDeploy(folderDeploy)
createDeploymentDirectory(folderDeploy)
logger.debug('Truncated components...')
}
fileManager.copy(excludeFiles(fileManager.getValidElements(projectPath)), folderDeploy)
componentDeploy.startMessage = DEPLOYING_CODE
componentDeploy.successMessage = DEPLOYING_CODE_SUCCESSFULLY
deployToSalesForce()
logger.debug('Deployed components...')
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public enum MetadataComponents {
COMPACTLAYOUTS("CompactLayout", "sbc", "compactLayouts"),
RECORDTYPES("RecordType", "sbc", "recordTypes"),
VALIDATIONRULES("ValidationRule", "sbc", "validationRules"),
BUSINESSPROCESSES("BusinessProcess", "sbc", "businessProcesses"),
FIELDSETS("FieldSet", "sbc", "fieldSets"),
LISTVIEWS("ListView", "sbc", "listViews"),
SHARINGREASON("SharingReason", "sbc", "SharingReason"),
OBJECTWEBLINKS("Weblink", "sbc", "webLinks"),
CUSTOMPERMISSIONS("CustomPermission", "customPermission", "customPermissions")

public final static Map<String, MetadataComponents> COMPONENT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ComponentTest extends Specification {
when:
componentContent.execute(file)
then:
file.text == expectedContent
file.text.replaceAll("\\s*","") == expectedContent.replaceAll("\\s*","")
}
def cleanupSpec() {
new File(TRUNCATED_PATH).deleteDir()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ class MetadataComponentsTest extends Specification {
def "Test enum name is equals to directory name"() {
expect:
MetadataComponents.COMPONENT.each {key, value->
assert key == value.directory.toUpperCase()
if(value.extension != 'sbc') {
assert key == value.directory.toUpperCase()
}
}
}

Expand Down

0 comments on commit 5b04801

Please sign in to comment.