Add Main-Class for cpp-build tools JAR.
authorDaniel Pocock <daniel@pocock.pro>
Wed, 27 Aug 2014 19:13:52 +0000 (19:13 +0000)
committerYoungjae Shin <yj99.shin@samsung.com>
Tue, 9 Jun 2015 11:43:19 +0000 (20:43 +0900)
- Adds the manifest entries to the basic tools JAR.

- Creates a symlink named like the dependencies JAR that was used
  previously.

- Creates a symlink to the protobuf JAR.

In the manifest, the classpath reference to the protobuf JAR is a
relative filename. The second symbolic link satisfies that by linking to
the installed JAR.

This is only needed for people building packages

People who build normally with Maven will find that "mvn package" still
produces the original tools JAR which has its own Main-Class attribute

Author: daniel@pocock.pro

debian/rules
tools/java/cpp-build/pom.xml

index 7e24879..e4f1f82 100755 (executable)
@@ -62,6 +62,8 @@ configure/libphonenumber6::
 #      ln -s /usr/share/java/junit4.jar java/lib/junit-4.8.1.jar
 #      $(ANT) -f $(JAVA_BUILD).xml jar
 build/libphonenumber6::
+       ln -sf cpp-build-1.0-SNAPSHOT.jar tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar
+       ln -sf /usr/share/java/protobuf.jar tools/java/cpp-build/target/protobuf-java-debian.jar
        $(MAKE) -C $(CPP_BUILD) phonenumber phonenumber-shared
 
 #override_dh_auto_test:
index a60798c..abe3cac 100644 (file)
           </arguments>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifest>
+              <addClasspath>true</addClasspath>
+              <mainClass>com.google.i18n.phonenumbers.EntryPoint</mainClass>
+            </manifest>
+          </archive>
+        </configuration>
+      </plugin>
       <!-- Build a JAR with its dependencies (protocol buffers and common library). This JAR
            contains the C++ build tools invoked by CMake during the libphonenumber C++ build. -->
       <plugin>