Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] Generate bundle.properties file during build

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


Back to the top