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

Maven repository #1

Open
dontsu opened this issue Jun 11, 2014 · 10 comments
Open

Maven repository #1

dontsu opened this issue Jun 11, 2014 · 10 comments

Comments

@dontsu
Copy link

dontsu commented Jun 11, 2014

Is the jav8 added to maven public repository to reuse the jav8 library in a maven project?

@pose
Copy link
Owner

pose commented Jun 11, 2014

Hi @dontsu,

Unfortunately, it's not been added to a public repository. You will need to build it manually. If you want, you can upload it to Sonatype repositories.

Thanks in advance,

@dontsu
Copy link
Author

dontsu commented Jun 15, 2014

Thank you for reply @pose,
I have an question about this part:


v8
${v8.path}/out/native

In my V8 build there is no such path: out/native.
Looking at the comment, I changed it to : ${v8.path}/build/Release/lib
But then I have a bunch of errors when maven runs. This is a piece of it:
[ERROR] c:\jav8\src\main\c++\jav8.cpp(338) : error C2660: 'v8::Number::New' : function does not take 1 arguments
My console is full of such errors. Any idea what can be wrong?

Regards,
Diana

@pose
Copy link
Owner

pose commented Jun 15, 2014

It could be possible that there were some breaking changes in the newest version of v8. What version are you using?

@dontsu
Copy link
Author

dontsu commented Jun 15, 2014

I downloaded the latest version from V8 github repo.
Note: I am building it on Win, not Unix or Mac.

@pose
Copy link
Owner

pose commented Jun 15, 2014

Yes, I've last tried this 2 years ago and it was working in Mac OS X. It's possible that the signatures of the methods have changed. Also, check that in Maven systemIncludePath variable is correctly set to the include path.

@dontsu
Copy link
Author

dontsu commented Jun 15, 2014

@pose Could you post the list of files that you have under out/native folder?
Even if the signatures would change, I don't think they would remove the old ones, I would expect to see them deprecated. I already rebuild V8 twice to make sure I didn't miss something. systemIncludePath is correct, I verified the folder.
It might be changed the project structure, that's why I am asking for the list of libs, to try and match what I have with what was under out/native.
Regards,
Diana

@pose
Copy link
Owner

pose commented Jun 16, 2014

Yes, sure.

❯ l out/native
total 1006880
drwxr-xr-x   3 apose  staff   102B Jun 16 13:49 .deps
drwxr-xr-x   3 apose  staff   102B Jun 16 13:59 obj
-rw-r--r--   1 apose  staff    18M Jun 16 14:13 libicui18n.a
-rw-r--r--   1 apose  staff    10M Jun 16 14:13 libicuuc.a
-rw-r--r--   1 apose  staff   2.3M Jun 16 14:14 libv8_snapshot.a
-rwxr-xr-x   1 apose  staff    22M Jun 16 14:14 shell
-rwxr-xr-x   1 apose  staff    22M Jun 16 14:14 process
-rwxr-xr-x   1 apose  staff    22M Jun 16 14:14 lineprocessor
-rwxr-xr-x   1 apose  staff    22M Jun 16 14:14 d8
-rwxr-xr-x   1 apose  staff    37M Jun 16 14:17 cctest
-rwxr-xr-x   1 apose  staff    22M Jun 16 14:17 lexer-shell
-rwxr-xr-x   1 apose  staff    22M Jun 16 14:17 parser-shell
drwxr-xr-x  21 apose  staff   714B Jun 16 14:17 obj.target
drwxr-xr-x  12 apose  staff   408B Jun 16 14:17 ..
-rw-r--r--   1 apose  staff   9.5M Jun 16 14:17 libicudata.a
-rwxr-xr-x   1 apose  staff    11M Jun 16 14:18 libicuuc.dylib
-rwxr-xr-x   1 apose  staff   2.4M Jun 16 14:19 libicui18n.dylib
-rw-r--r--   1 apose  staff   262M Jun 16 14:25 libv8_base.a
-rw-r--r--   1 apose  staff   1.5M Jun 16 14:25 libv8_nosnapshot.a
-rwxr-xr-x   1 apose  staff   8.2M Jun 16 14:25 mksnapshot
-rw-r--r--   1 apose  staff   7.6K Jun 16 14:25 libv8_libbase.a
drwxr-xr-x  22 apose  staff   748B Jun 16 14:25 .

BTW, I'm having some build issues with v8 (but it's unrelated with jav8).

@dontsu
Copy link
Author

dontsu commented Jun 16, 2014

I got is passing this issue by changing pom.xml. There was one issue with nar-maven too. My xml looks now like this:

<?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>
  <groupId>lu.flier.script</groupId>
  <artifactId>jav8</artifactId>
  <version>0.4-SNAPSHOT</version>
  <name>jav8</name>
  <packaging>nar</packaging>
  <properties>
    <nar.version.number>3.1.0</nar.version.number>
    <!-- this is required for the nar-maven-plugin (it takes
         the tests and runs them in the nar:nar-integration-test
         phase -->
    <skipTests>true</skipTests>
    <v8.path>C:\v8</v8.path>
  </properties>
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.maven-nar</groupId>
        <artifactId>nar-maven-plugin</artifactId>
        <version>${nar.version.number}</version>
        <extensions>true</extensions>
        <configuration>
          <libraries>
            <library>
              <type>jni</type>
              <!-- This is how the generated .h files prefix would be -->
              <narSystemPackage>lu.flier.script</narSystemPackage>
            </library>
          </libraries>
          <cpp>
            <systemIncludePaths>
              <!-- v8 includes -->
              <systemIncludePath>
              ${v8.path}/include</systemIncludePath>
            </systemIncludePaths>
            <defines>
                <!-- Convert the array content when wrap it 
                     (not working for me yet :( ) -->
                <!-- <define>USE_NATIVE_ARRAY</define> -->

                <!-- Hack: Use V8 Internal stuff in the native libraries 
                     not working for me, I think it is attached to an older 
                     version and code changed -->
                <!-- <define>USE_INTERNAL_V8_API</define> -->

                <!-- V8 Isolate Support --> 
                <define>V8_SUPPORT_ISOLATE</define>
            </defines>
          </cpp>
          <linker>
            <libs>
              <lib>
                <!-- v8 lib, "-lv8" -->
                <name>v8</name>
                <directory>${v8.path}/build/Release</directory>
              </lib>
            </libs>
          </linker>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.9</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

But now compilation fails with many different messages like this:
[ERROR] c:\jav8\src\main\c++\jav8.cpp(559) : error C2039: 'Set' : is not a member of 'v8::Persistent'

What building issue do you have?

@pose
Copy link
Owner

pose commented Jun 23, 2014

Hi @dontsu,

How are you? Sorry, I haven't forgotten about this but I did not have the time to take a look at this yet. My build error was related to the type of library I was creating, I think it worked when compiling it as static but not as shared. I'll get back to you about the specific error.

Thanks in advance,

@dontsu
Copy link
Author

dontsu commented Jun 23, 2014

Hi @pose

I didn't have the chance to dig and figure out what is wrong. Will get back to it once, I have time to investigate and research the root cause of exceptions I get.
If you get the same error, then probably the V8 latest version is not compatible with jaV8. If yours is different and you succeed to get further, then I will try to fix mine as soon as I have time.
Anyway thank you for your time!

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

2 participants