qickrooms / flex-mojos

Automatically exported from code.google.com/p/flex-mojos
0 stars 0 forks source link

Mechanism to reference external properties file for compiler defines configuration #136

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
N/A; This is an enhancement request. I'd like to be able to reference
external properties files to initialize flex compiler "defines"
configuration. Quite often the defines I'd like to specify are dynamically
generated at build time (e.g. timestamp, revision). Without this option, it
is difficult to push these generated values back into Maven runtime as
properties with which I might configure flex-compiler-mojo:

<plugin>
  <groupId>info.flex-mojos</groupId>
  <artifactId>flex-compiler-mojo</artifactId>
  <version>2.0M9</version>
  <extensions>true</extensions>
  <configuration>
    ...
    <defines>
      <build::revision>${revision}</build::revision>
      <build::timestamp>${timestamp}</build::timestamp>
    </defines>
    ...
  </configuration>
</plugin>

What is the expected output? What do you see instead?
I'd love to see some configuration option similar to the following:

<plugin>
  <groupId>info.flex-mojos</groupId>
  <artifactId>flex-compiler-mojo</artifactId>
  <version>2.0M9</version>
  <extensions>true</extensions>
  <configuration>
    ...
    <defines file="path/to/defines.properties" />
    ...
  </configuration>
</plugin>

Where the generated "path/to/defines.properties" file might contain:

build\:\:revision = 12345
build\:\:timestamp = 2008-11-01 12:00:00.000 -0005

What version of the product are you using? On what operating system?
Windows XP pro 64-bit
Sun JDK 1.6.0_10 32-bit
Maven 2.0.9
flex-compiler-mojo 2.0M9

Please provide any additional information below.

Original issue reported on code.google.com by andrew.s...@gmail.com on 23 Nov 2008 at 11:23

GoogleCodeExporter commented 9 years ago
Apologies for not labeling this issue as an Enhancement. For some reason the 
issue
creation page didn't give me the option to change the issue type..

Original comment by andrew.s...@gmail.com on 23 Nov 2008 at 11:29

GoogleCodeExporter commented 9 years ago
I've created a patch against flex-mojos 2.0M9 which adds a "definesFile" 
@property to
the compiler mojo, along with proper documentation. Please see attachment.

Original comment by andrew.s...@gmail.com on 24 Nov 2008 at 12:25

Attachments:

GoogleCodeExporter commented 9 years ago
I don't get why you wanna that....

Maven doesn't read properties from files, does it?

VELO

Original comment by velo...@gmail.com on 24 Nov 2008 at 12:43

GoogleCodeExporter commented 9 years ago
No, Maven does not read properties from files. However, it does read filters 
from
properties files. Previously, I'd been generating filter properties files to 
ensure
certain dynamic name-value pairs were injected into filtered resources.

In this scenario, if I want a dynamic name-value pair to get into my flex code, 
I
have to create a filter file and then apply it to some actionscript source file 
to
inject those values into the source before compile.

With this extension, I don't have to prefilter actionscript source. I just point
flex-compiler-mojo at my generated filter file and then I can reference the
definitions within the rest of my actionscript code.

Original comment by andrew.s...@gmail.com on 24 Nov 2008 at 12:49

GoogleCodeExporter commented 9 years ago
Velo, please close this ticket if you like. I'm satisfied with an alternate 
source
generation approach.

Original comment by andrew.s...@gmail.com on 24 Nov 2008 at 8:45

GoogleCodeExporter commented 9 years ago
andrew, just making sure you're aware of 
http://blog.flex-mojos.info/2008/06/16/adding-svn-build-number-
and-timestamp/ just in case it would meet your needs for now.

Original comment by RedB...@gmail.com on 24 Nov 2008 at 9:03

GoogleCodeExporter commented 9 years ago
Thanks RedBugz. I had run into buildnumber-maven-plugin. My only reservation
concerning its use is how revision information is packaged with various 
distribution
assemblies. It seems to support pushing build numbers etc into jar manifests, 
but
this doesn't quite work for flex projects.. For the moment I'm using a bit of 
Ant
script to generate a dist.properties file which includes build/release data when
assembling distributions. The same script takes care of generation of local 
build
info via svnversion, so it kind of obviates the use of the 
buildnumber-maven-plugin.

Cheers,

Original comment by andrew.s...@gmail.com on 24 Nov 2008 at 9:11

GoogleCodeExporter commented 9 years ago
Ok, if you are happy =P

Original comment by velo...@gmail.com on 24 Nov 2008 at 10:56