Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiOS #86

Closed
pianista215 opened this issue Aug 31, 2015 · 11 comments
Closed

MultiOS #86

pianista215 opened this issue Aug 31, 2015 · 11 comments

Comments

@pianista215
Copy link

I'm working in a Less Compiler ( https://github.com/pianista215/java-lesscss )using J2V8 and the most of the work is done, but for me the question is:

If I have developers that use Windows as OS, but the servers are on Linux machines:

How can we ensure that the J2V8 will work without changing the pom dependency from windows to linux?

Is there no way to have a master J2V8 which loads the needed libraries depending of the host OS?

Regards!

@jason-parkhurst
Copy link

Maven can handle platform specific dependencies. Just add a section like this in the profiles section of your pom:

        <profile>
            <id>windows</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.eclipsesource.j2v8</groupId>
                    <artifactId>j2v8_win32_x86_64</artifactId>
                    <version>3.0.1</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>linux</id>
            <activation>
                <os>
                    <family>unix</family>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.eclipsesource.j2v8</groupId>
                    <artifactId>j2v8_linux_x86_64</artifactId>
                    <version>3.0.1</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>mac</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.eclipsesource.j2v8</groupId>
                    <artifactId>j2v8_macosx_x86_64</artifactId>
                    <version>3.0.1</version>
                </dependency>
            </dependencies>
        </profile>

@pianista215
Copy link
Author

But with that you are solving the problem of compiling in different platforms, not the problem of deploy.

For example imagine I'm developing on windows, and I generate the binary for my linux server, cause I'm on windows I will generate the .jar/ear/war with the windows dependency and won't work on the linux server.

@ccantill
Copy link

ccantill commented Sep 9, 2015

I solved this manually by just copying all the different library versions (.so, .dll, .dylib) into a single jar and uploading that to our nexus.

@pianista215
Copy link
Author

Thanks @ccantill , so the library is able to recognize all of that without changes?

I was wondering that the pom contained specifically routes internally and this approach wouldn't work, but If you have reason is a very reasonable way :)

@ccantill
Copy link

Looks like it :) We use the same jar on Windows and Linux and it so far it's always loaded the right library.

@pianista215
Copy link
Author

May be a good idea is to deploy this on MavenCentral in order to have that. But may be only the owner is available to do that.
I will try it ;)

@erikhakansson
Copy link

A simple solution is to create a separate module (e.g. j2v8-bundle) that has all platform versions as dependencies, then have this plugin:

 <!-- Maven Shade Plugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
                <!-- Run shade goal on package phase -->
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                </execution>
            </execution>
            <configuration>
                <createDependencyReducedPom>false</createDependencyReducedPom>
                <createSourcesJar>true</createSourcesJar>
            </configuration>
        </plugin>

That should build a combined jar.
But yeah, the owner should release an "-all" jar to maven central.

@irbull
Copy link
Member

irbull commented Feb 15, 2017

When I first created J2V8 I had an all in one jar, and people used it by default and complained it was too big. I'm happy to put it back. I guess we don't need the android parts in there, do we? What should be included? My thoughts are Mac64, Linux 64, Windows 32 & 64?

@erikhakansson
Copy link

Yeah it does get big, but as long as it's a separate option from the individual platform jars I don't think that's a huge issue.

And I agree on what parts to include. That's what I use.

@ghost
Copy link

ghost commented Apr 18, 2017

Would be great to get the bundled option.

@irbull
Copy link
Member

irbull commented Jan 10, 2019

We are reducing the scope of this project to V8 on Android. I'm happy if someone else wants to maintain other platforms, but I don't have the cycles to do. See #441. I'm closing this as out of scope. If someone would like to take over the builds for these platforms, let me know. I'd be happy to link to you in the README.

@irbull irbull closed this as completed Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants