Permalink
Browse files

chore: rework update-translations.sh into pom file as a profile

Closes #479
  • Loading branch information...
crunchyjohn authored and vlsi committed Dec 29, 2015
1 parent e52f7e3 commit e2fa9ecfd289acde98cba768e008088838cd9c6e
Showing with 97 additions and 14 deletions.
  1. +17 −0 README.md
  2. +80 −0 pgjdbc/pom.xml
  3. +0 −14 update-translations.sh
@@ -79,6 +79,10 @@ In order to build the source code for PgJDBC you will need the following tools:
- A JDK for the JDBC version you'd like to build (JDK6 for JDBC 4, JDK7 for JDBC 4.1 or JDK8 for JDBC 4.2)
- A running PostgreSQL instance

Additionally, in order to update translations (not typical), you will need the following additional tools:

- the gettext package, which contains the commands "msgfmt", "msgmerge", and "xgettext"

## Checking out the source code

The PgJDBC project uses git for version control. You can check out the current code by running:
@@ -162,6 +166,19 @@ Here's sample configuration for Mac OS:
</toolchains>
```

## Updating translations

From time to time, the translation packages will need to be updated as part of the build process.
However, this is atypical, and is generally only done when needed such as by a project committer before a major release.
This process adds additional compile time and generally should not be executed for every build.

Updating translations can be accomplished with the following command:

mvn -Ptranslate compile && git add pgjdbc && git commit -m "Translations updated"

Note that the maven profile "translate" can safely be called with other profiles, such as -P release-artifacts.
Invocation of this command will generate new .po files, a new messages.pot file, and newly translated class files.

## Releasing a snapshot version

TravisCI automatically deploys snapshots for each commit to master branch.
@@ -37,6 +37,86 @@
<skip.assembly>false</skip.assembly>
</properties>

<profiles>
<profile>
<id>translate</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.gettext-commons</groupId>
<artifactId>gettext-maven-plugin</artifactId>
<version>1.2.4</version>
<executions>
<execution>
<id>generate_pot_and_po_files</id>
<phase>generate-resources</phase>
<goals>
<goal>merge</goal>
</goals>
<configuration>
<outputDirectory>src/main/resources</outputDirectory>
</configuration>
</execution>
<execution>
<id>generate_resource_bundles</id>
<phase>generate-resources</phase>
<goals>
<goal>dist</goal>
</goals>
</execution>
</executions>
<configuration>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<outputDirectory>src/main/resources</outputDirectory>
<keysFile>messages.pot</keysFile>
<poDirectory>src/main/java/org/postgresql/translation</poDirectory>
<targetBundle>org.postgresql.translation.messages</targetBundle>
<keywords>-kGT.tr</keywords>
<msgmergeCmd>msgmerge</msgmergeCmd>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>clean_msmerge_backups</id>
<goals>
<goal>clean</goal>
</goals>
<phase>compile</phase>
<configuration>
<!-- Do not delete target folder -->
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>src/main/resources/org/postgresql/translation</directory>
<includes>
<include>**$*.class</include>
<include>messages.properties</include>
<include>messages_en.properties</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>src/main/java/org/postgresql/translation</directory>
<includes>
<include>*.po.~*~</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>

This file was deleted.

Oops, something went wrong.

0 comments on commit e2fa9ec

Please sign in to comment.