Merge branch '1.0.x'

fixes #167
This commit is contained in:
Marcin Grzejszczak
2016-12-28 12:52:15 +01:00
17 changed files with 228 additions and 14 deletions

View File

@@ -67,6 +67,13 @@ class RecursiveFilesConverter {
File sourceFile = contract.path.toFile()
StubGenerator stubGenerator = holder.converterForName(sourceFile.name);
try {
String path = sourceFile.path
if (properties.isExcludeBuildFolders() && (matchesPath(path, "target") || matchesPath(path, "build"))) {
if (log.isDebugEnabled()) {
log.debug("Exclude build folder is set. Path [${path}] contains [target] or [build] in its path")
}
return
}
if (!contract.convertedContract && !stubGenerator) {
return
}
@@ -90,6 +97,10 @@ class RecursiveFilesConverter {
}
}
private boolean matchesPath(String path, String folder) {
return path.matches("^.*${File.separator}${folder}${File.separator}.*\$")
}
private Path createAndReturnTargetDirectory(File sourceFile) {
Path relativePath = Paths.get(properties.contractsDslDir.toURI()).relativize(sourceFile.parentFile.toPath())
Path absoluteTargetPath = outMappingsDir.toPath().resolve(relativePath)

View File

@@ -80,13 +80,21 @@ class RecursiveFilesConverter {
properties.excludedFiles as Set, [] as Set, properties.includedContracts)
ListMultimap<Path, ContractMetadata> contracts = scanner.findContracts()
if (log.isDebugEnabled()) {
log.debug("Found the following contracts $contracts")
log.debug("Found the following contracts ${contracts}")
log.debug("Exclude build folder: [${properties.isExcludeBuildFolders()}]")
}
contracts.asMap().entrySet().each { entry ->
entry.value.each { ContractMetadata contract ->
File sourceFile = contract.path.toFile()
StubGenerator stubGenerator = holder.converterForName(sourceFile.name);
try {
String path = sourceFile.path
if (properties.isExcludeBuildFolders() && (matchesPath(path, "target") || matchesPath(path, "build"))) {
if (log.isDebugEnabled()) {
log.debug("Exclude build folder is set. Path [${path}] contains [target] or [build] in its path")
}
return
}
if (!contract.convertedContract && !stubGenerator) {
return
}
@@ -110,6 +118,10 @@ class RecursiveFilesConverter {
}
}
private boolean matchesPath(String path, String folder) {
return path.matches("^.*${File.separator}${folder}${File.separator}.*\$")
}
private Path createAndReturnTargetDirectory(File sourceFile) {
Path relativePath = Paths.get(properties.contractsDslDir.toURI()).relativize(sourceFile.parentFile.toPath())
Path absoluteTargetPath = outMappingsDir.toPath().resolve(relativePath)