[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| 
Re: [tycho-user] Generate bundle.properties file during build
 | 
Hi,
If you look at the bottom of my mail you'll see that I use the 
tycho-packaging-plugin already. I've experiemented further and found a couple 
of things:
- it seems I need to specify the relative path (to the build directory) for 
the additionalFileSet to pick up the file and place it in that relative path 
in the generated plugin jar
- I cannot have 2 active profile's that each setup a different configuration 
of additional files to include for the tycho-packaging-plugin
So moving the configuration of the tycho-packaging-plugin out of the 
profile's into the general pom part and merging the include's for the two 
different files makes my setup work.
Any idea wether a bugreport about the last point is worthwhile - I'm using 
tycho 0.21. Since I'm still a maven/tycho beginner I'm just not sure wether 
the setup with 2 profiles configuring the packaging plugin in different ways 
should work or is something that lies outside the intended use-cases of 
profiles.
Andreas
On 2015-10-28 09:34, Sievers, Jan wrote:
try 
https://eclipse.org/tycho/sitedocs/tycho-packaging-plugin/package-plugin-mojo.html#additionalFileSets
Jan
On 27/10/15 22:28, "tycho-user-bounces@xxxxxxxxxxx on behalf of Andreas 
Pakulat" <tycho-user-bounces@xxxxxxxxxxx on behalf of
andreas@xxxxxxxxxxxxx> wrote:
Hi,
I'm trying to replace a placeholder in the bundle.properties of a plugin
during the prepare-package phase. I've setup a profile that is activated
based on the existence of the 'template' file similarly to how EPP 
generates
an about.mappings file in the final plugin to contain the Eclipse version 
and
build id.
I can see the generated bundle.properties in the target directory, but the
final plugin always gets the original source file with the placeholders and
I'm failing to see the difference between the logics for about.mappings and
for bundle.properties. Anybody can give me a hint?
This is the profile for about.mappings copied from 
org.eclipse.epp.packages:
<profile>
      <id>update-branding-plugins-about.mappings</id>
      <activation>
        <file>
          <exists>${basedir}/about.mappings</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.6</version>
            <executions>
              <execution>
                <id>process-about.mappings</id>
                <phase>prepare-package</phase>
                <configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
                  <overwrite>true</overwrite>
                  <resources>
                    <resource>
                      <directory>${basedir}</directory>
                      <includes>
                        <include>about.mappings</include>
                      </includes>
                      <filtering>true</filtering>
                    </resource>
                  </resources>
                </configuration>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-packaging-plugin</artifactId>
            <version>${tycho-version}</version>
            <configuration>
              <additionalFileSets>
                <fileSet>
                  <directory>${project.build.directory}</directory>
                  <includes>
                    <include>about.mappings</include>
                  </includes>
                </fileSet>
              </additionalFileSets>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
Based on that I added (to the same pom.xml):
    <profile>
      <id>update-bundle.properties</id>
      <activation>
        <file>
          <exists>${basedir}/OSGI-INF/l10n/bundle.properties</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.6</version>
            <executions>
              <execution>
                <id>process-bundle.properties</id>
                <phase>prepare-package</phase>
                <configuration>
<outputDirectory>${project.build.directory}/OSGI-INF/l10n</outputDirectory>
                  <overwrite>true</overwrite>
                  <resources>
                    <resource>
                      <directory>${basedir}/OSGI-INF/l10n</directory>
                      <includes>
                        <include>bundle.properties</include>
                      </includes>
                      <filtering>true</filtering>
                    </resource>
                  </resources>
                </configuration>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-packaging-plugin</artifactId>
            <version>${tycho-version}</version>
            <configuration>
              <additionalFileSets>
                <fileSet>
<directory>${project.build.directory}/OSGI-INF/l10n</directory>
                  <includes>
                    <include>bundle.properties</include>
                  </includes>
                </fileSet>
              </additionalFileSets>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
Andreas
--
Andreas Pakulat squish@xxxxxxxxxxxxx
froglogic GmbH - Automated UI and Web Testing
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe 
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Andreas Pakulat squish@xxxxxxxxxxxxx
froglogic GmbH - Automated UI and Web Testing