Itiviti / gradle-msbuild-plugin

Gradle plugin for msbuild execution, supports C# project files for now
Apache License 2.0
101 stars 58 forks source link

Support more fields at AssemblyInfoVersionPatcher task #110

Closed haimadrian closed 5 years ago

haimadrian commented 5 years ago

Hi,

Currently, AssemblyInfoVersionPatcher supports customizing those fields:

  1. AssemblyVersion
  2. AssemblyFileVersion
  3. AssemblyInformationalVersion
  4. AssemblyDescription

There are additional fields I would like to customize as part of product build:

  1. AssemblyTitle
  2. AssemblyCompany
  3. AssemblyProduct
  4. AssemblyCopyright
  5. AssemblyTrademark

Is it possible to modify or extend current AssemblyInfoVersionPatcher such that it will get a map as @ Input, where I put all desired fields? Declaring additional input members is fine as well

Thank you very much!

ngyukman commented 5 years ago

hi @haimadrian

any reason you want to customize those fields when patching the version? as the patcher was intended to update the version from gradle's project property but for product and company names they could be hard coded in the source directly

haimadrian commented 5 years ago

Hi and thanks for the reply. Let's take for example AssemblyCopyright, where I want to update the year based on current year. The other fields are required for the assemblies to be updated based on the product that ship them. I have 4 different products shipping the assemblies as a driver, and I want the assembly title, trademark, etc. to get updated according to the product's name.

I could use TokenReplacer to do that, but just thought it could be nice using AssemblyInfoVersionPatcher with a map containing all of the fields I need

ngyukman commented 5 years ago

thanks for your clarification, imo adding additional input parameter to AssemblyInfoVersionPatcher is better than a map