JaroslavTulach: /* Converting Truffle */ - 2017-08-18 16:44:53

Converting Truffle

←Older revision Revision as of 16:44, 18 August 2017
Line 122: Line 122:
<groupId>org.apache.felix</groupId>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<artifactId>maven-bundle-plugin</artifactId>
-
<version>2.3.7</version>
+
<version>3.3.0</version>
<extensions>true</extensions>
<extensions>true</extensions>
<configuration>
<configuration>
Line 131: Line 131:
<Private-Package>META-INF.*,com.*</Private-Package>
<Private-Package>META-INF.*,com.*</Private-Package>
</instructions>
</instructions>
 +
<Embed-Dependency>*;scope=provided</Embed-Dependency>
</configuration>
</configuration>
</plugin>
</plugin>

JaroslavTulach at 16:43, 18 August 2017 - 2017-08-18 16:43:47

←Older revision Revision as of 16:43, 18 August 2017
Line 44: Line 44:
<groupId>org.apache.felix</groupId>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<artifactId>maven-bundle-plugin</artifactId>
-
<version>2.3.7</version>
+
<version>3.3.0</version>
<extensions>true</extensions>
<extensions>true</extensions>
<configuration>
<configuration>
Line 53: Line 53:
<Private-Package>com.sun.*</Private-Package>
<Private-Package>com.sun.*</Private-Package>
</instructions>
</instructions>
 +
<Embed-Dependency>*;scope=provided</Embed-Dependency>
</configuration>
</configuration>
</plugin>
</plugin>

JaroslavTulach: /* Converting Truffle */ - 2017-03-15 05:30:14

Converting Truffle

←Older revision Revision as of 05:30, 15 March 2017
Line 96: Line 96:
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them effectively [[ObfuscatePerLibrary|per library]] - see the [[Bck2BrwsrLibraries]] howto!
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them effectively [[ObfuscatePerLibrary|per library]] - see the [[Bck2BrwsrLibraries]] howto!
-
=== Converting [[Truffle]] ===
+
==== Converting [[Truffle]] ====
I've just converted [[Truffle]] to [[OSGi]] bundle with following simple script. As I was interested only in {{truffle|com/oracle/truffle/api/vm|PolyglotEngine}} class,
I've just converted [[Truffle]] to [[OSGi]] bundle with following simple script. As I was interested only in {{truffle|com/oracle/truffle/api/vm|PolyglotEngine}} class,

JaroslavTulach at 03:44, 16 January 2017 - 2017-01-16 03:44:12

←Older revision Revision as of 03:44, 16 January 2017
Line 95: Line 95:
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them effectively [[ObfuscatePerLibrary|per library]] - see the [[Bck2BrwsrLibraries]] howto!
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them effectively [[ObfuscatePerLibrary|per library]] - see the [[Bck2BrwsrLibraries]] howto!
 +
 +
=== Converting [[Truffle]] ===
 +
 +
I've just converted [[Truffle]] to [[OSGi]] bundle with following simple script. As I was interested only in {{truffle|com/oracle/truffle/api/vm|PolyglotEngine}} class,
 +
[[I]] exported just the single package:
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 +
<modelVersion>4.0.0</modelVersion>
 +
<artifactId>truffleosgi</artifactId>
 +
<groupId>org.apidesign.demo</groupId>
 +
<packaging>bundle</packaging>
 +
<version>1.0-SNAPSHOT</version>
 +
<dependencies>
 +
<dependency>
 +
<groupId>com.oracle.truffle</groupId>
 +
<artifactId>truffle-api</artifactId>
 +
<version>0.22</version>
 +
<scope>provided</scope>
 +
</dependency>
 +
</dependencies>
 +
<build>
 +
<plugins>
 +
<plugin>
 +
<groupId>org.apache.felix</groupId>
 +
<artifactId>maven-bundle-plugin</artifactId>
 +
<version>2.3.7</version>
 +
<extensions>true</extensions>
 +
<configuration>
 +
<instructions>
 +
<!-- I am interested only in PolyglotEngine -->
 +
<Export-Package>com.oracle.truffle.api.vm</Export-Package>
 +
<!-- list other packages that should be included in your bundle -->
 +
<Private-Package>META-INF.*,com.*</Private-Package>
 +
</instructions>
 +
</configuration>
 +
</plugin>
 +
</plugins>
 +
</build>
 +
</project>
 +
</source>

JaroslavTulach at 08:30, 11 January 2015 - 2015-01-11 08:30:50

←Older revision Revision as of 08:30, 11 January 2015
Line 94: Line 94:
</source>
</source>
-
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them effectively [[ObfuscatePerLibrary|per library]]!
+
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them effectively [[ObfuscatePerLibrary|per library]] - see the [[Bck2BrwsrLibraries]] howto!

JaroslavTulach at 14:02, 29 November 2014 - 2014-11-29 14:02:06

←Older revision Revision as of 14:02, 29 November 2014
Line 48: Line 48:
<configuration>
<configuration>
<instructions>
<instructions>
-
<!-- export the packages that should be accessible -->
+
<!-- export the packages that should be externally accessible -->
<Export-Package>javax.*</Export-Package>
<Export-Package>javax.*</Export-Package>
<!-- list other packages that should be included in your bundle -->
<!-- list other packages that should be included in your bundle -->

JaroslavTulach at 13:38, 29 November 2014 - 2014-11-29 13:38:23

←Older revision Revision as of 13:38, 29 November 2014
Line 60: Line 60:
</source>
</source>
-
And that is all! After building the project, you'll get an [[OSGi]] bundle that contains all the classes from the specified dependency found in ''exported'' and ''private'' packages. Copy the above file into pom.xml and execute:
+
And that is all! After building the project, you'll get an [[OSGi]] bundle that contains all the classes from the specified dependency found in ''exported'' and ''private'' packages. Just copy the above text into '''pom.xml''' file and in its directory execute yourself:
<source lang="bash">
<source lang="bash">
Line 70: Line 70:
5109 2014-02-14 11:53 javax/annotation/processing/AbstractProcessor.class
5109 2014-02-14 11:53 javax/annotation/processing/AbstractProcessor.class
# ...shortened
# ...shortened
 +
$ unzip -p target/jar-id-1.0-SNAPSHOT.jar META*MAN*
 +
Manifest-Version: 1.0
 +
Bnd-LastModified: 1417267436493
 +
Build-Jdk: 1.8.0_25
 +
Bundle-ManifestVersion: 2
 +
Bundle-Name: jar-id
 +
Bundle-SymbolicName: your.group.id.jar-id
 +
Bundle-Version: 1.0.0.SNAPSHOT
 +
Created-By: Apache Maven Bundle Plugin
 +
Export-Package: javax.annotation.processing;uses:="javax.lang.model,java
 +
x.tools,javax.lang.model.element,javax.lang.model.util";version="1.0.0.
 +
SNAPSHOT",javax.lang.model.util;uses:="javax.annotation.processing,java
 +
x.lang.model,javax.lang.model.element,javax.lang.model.type";version="1
 +
.0.0.SNAPSHOT",javax.lang.model;uses:="javax.lang.model.element";versio
 +
n="1.0.0.SNAPSHOT",javax.tools;uses:="javax.lang.model.element,javax.an
 +
notation.processing,javax.lang.model";version="1.0.0.SNAPSHOT",javax.la
 +
ng.model.type;uses:="javax.lang.model.element,javax.lang.model";version
 +
="1.0.0.SNAPSHOT",javax.lang.model.element;uses:="javax.lang.model.type
 +
,javax.lang.model";version="1.0.0.SNAPSHOT"
 +
Import-Package: javax.annotation.processing,javax.lang.model.element,jav
 +
ax.lang.model.type,javax.lang.model.util,javax.tools
 +
Tool: Bnd-1.50.0
</source>
</source>
-
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them [[ObfuscatePerLibrary|per library]].
+
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them effectively [[ObfuscatePerLibrary|per library]]!

JaroslavTulach at 13:24, 29 November 2014 - 2014-11-29 13:24:19

←Older revision Revision as of 13:24, 29 November 2014
Line 63: Line 63:
<source lang="bash">
<source lang="bash">
-
$ mvn install
+
$ mvn package
$ unzip -l target/jar-id-1.0-SNAPSHOT.jar
$ unzip -l target/jar-id-1.0-SNAPSHOT.jar
# shortened ...
# shortened ...

JaroslavTulach at 13:23, 29 November 2014 - 2014-11-29 13:23:21

←Older revision Revision as of 13:23, 29 November 2014
Line 69: Line 69:
125 2014-02-14 11:52 com/sun/source/util/package-info.class
125 2014-02-14 11:52 com/sun/source/util/package-info.class
5109 2014-02-14 11:53 javax/annotation/processing/AbstractProcessor.class
5109 2014-02-14 11:53 javax/annotation/processing/AbstractProcessor.class
-
# ...shorted
+
# ...shortened
</source>
</source>
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them [[ObfuscatePerLibrary|per library]].
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them [[ObfuscatePerLibrary|per library]].

JaroslavTulach at 13:22, 29 November 2014 - 2014-11-29 13:22:58

←Older revision Revision as of 13:22, 29 November 2014
Line 51: Line 51:
<Export-Package>javax.*</Export-Package>
<Export-Package>javax.*</Export-Package>
<!-- list other packages that should be included in your bundle -->
<!-- list other packages that should be included in your bundle -->
-
<Private-Package>com.sun.tools.*</Private-Package>
+
<Private-Package>com.sun.*</Private-Package>
</instructions>
</instructions>
</configuration>
</configuration>
Line 60: Line 60:
</source>
</source>
-
And that is all! After building the project, you'll get an [[OSGi]] bundle that contains all the classes from the specified dependency found in ''exported'' and ''private'' packages.
+
And that is all! After building the project, you'll get an [[OSGi]] bundle that contains all the classes from the specified dependency found in ''exported'' and ''private'' packages. Copy the above file into pom.xml and execute:
 +
 
 +
<source lang="bash">
 +
$ mvn install
 +
$ unzip -l target/jar-id-1.0-SNAPSHOT.jar
 +
# shortened ...
 +
4539 2014-02-14 11:52 com/sun/source/util/Trees.class
 +
125 2014-02-14 11:52 com/sun/source/util/package-info.class
 +
5109 2014-02-14 11:53 javax/annotation/processing/AbstractProcessor.class
 +
# ...shorted
 +
</source>
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them [[ObfuscatePerLibrary|per library]].
Wrap your [[JAR]]'s into [[OSGi]] bundles and let [[Bck2Brwsr]] obfuscate them [[ObfuscatePerLibrary|per library]].