Skip to content

Commit

Permalink
Fix regression
Browse files Browse the repository at this point in the history
Change-Id: I0f370706ccbb54e69b526c585ba6e431b59b86f8
  • Loading branch information
ngyukman committed Mar 18, 2019
1 parent a07fce0 commit 31914e3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# 3.3
### Fixed
* Failed to resolve msbuild in MacOS #113 (thanks @kkalisz)
* Failed to run AssemblyInfoPatcher when attribute is not set or patching AssemblyInfo.cs
* Improve warnings log when project not found

# 3.2
### Added
Expand Down
14 changes: 7 additions & 7 deletions src/main/groovy/com/ullink/AssemblyInfoVersionPatcher.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AssemblyInfoVersionPatcher extends DefaultTask {
if (it.properties.UsingMicrosoftNETSdk == 'true') {
it.properties.MSBuildProjectFullPath
} else {
it?.getItems('Compile').find { Files.getNameWithoutExtension(it) == 'AssemblyInfo' }
it?.getItems('Compile').find { Files.getNameWithoutExtension(it.name) == 'AssemblyInfo' }
}
}
}))
Expand Down Expand Up @@ -63,22 +63,22 @@ class AssemblyInfoVersionPatcher extends DefaultTask {
Property<String> informationalVersion

@Input
String title
String title = ''

@Input
String company
String company = ''

@Input
String product
String product = ''

@Input
String copyright
String copyright = ''

@Input
String trademark
String trademark = ''

@Input
String assemblyDescription
String assemblyDescription = ''

@Input
def charset = 'UTF-8'
Expand Down
10 changes: 7 additions & 3 deletions src/main/groovy/com/ullink/Msbuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ class Msbuild extends ConventionTask {

boolean resolveProject() {
if (projectParsed == null && parseProject) {
def rootProjectFile = getRootedProjectFile()
if (isSolutionBuild()) {
def result = parseProjectFile(getRootedSolutionFile())
def result = parseProjectFile(rootProjectFile)
allProjects = result.collectEntries { [it.key, new ProjectFileParser(msbuild: this, eval: it.value)] }
def projectName = getProjectName()
if (projectName == null || projectName.isEmpty()) {
Expand All @@ -157,12 +158,15 @@ class Msbuild extends ConventionTask {
}
}
} else if (isProjectBuild()) {
def result = parseProjectFile(getRootedProjectFile())
def result = parseProjectFile(rootProjectFile)
allProjects = result.collectEntries {[it.key, new ProjectFileParser(msbuild: this, eval: it.value)]}
projectParsed = allProjects.values().first()
if (!projectParsed) {
logger.warn "Parsed project ${rootProjectFile} is null (not a solution / project build)"
}
}
}
logger.warn "Parsed project is null (not a solution / project build)"

projectParsed != null
}

Expand Down

0 comments on commit 31914e3

Please sign in to comment.