Skip to content

Commit

Permalink
Improve error reporting if outputDirectory is not set
Browse files Browse the repository at this point in the history
fixes #15
  • Loading branch information
tkrullmann committed Jun 7, 2019
1 parent b11c641 commit be63ad7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class XjcGenerate extends SourceTask {

private static final Pattern LOCALE_PATTERN = ~/(?<language>\p{Alpha}{2,3})(-(?<region>\p{Alpha}{2}|\d{3}))?/

@Internal('Represented as part of packageOutputDirectory')
@Input
File outputDirectory

@InputFiles
Expand Down Expand Up @@ -114,9 +114,14 @@ class XjcGenerate extends SourceTask {

@OutputDirectory
@CheckForNull
@Optional
File getPackageOutputDirectory() {

File baseOutputDirectory = getOutputDirectory()
if (targetPackage == null) {

if (baseOutputDirectory == null) {
return null
} else if (targetPackage == null) {
return baseOutputDirectory
} else {
String targetPackagePath = targetPackage.replace('.' as char, File.separatorChar)
Expand Down

0 comments on commit be63ad7

Please sign in to comment.