Qpid Proton
  1. Qpid Proton
  2. PROTON-194

Change proton's build systems to allow for the creation of a Java binding for proton-c.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.4
    • Component/s: proton-c, proton-j
    • Labels:
      None

      Description

      The catalyst for this work was the need to conveniently build and test the JNI bindings created in PROTON-192. However, there are a number of other requirements for our build system that are worth reiterating.

      To avoid making excessive edits to this JIRA I've created a wiki page listing the provisional requirements of or build system: https://cwiki.apache.org/confluence/display/qpid/Proton+build+system+proposals

        Issue Links

          Activity

          Hide
          Gordon Sim added a comment -

          Ideally I think you would not want to impose java's toolchain on C developers (or indeed C's toolchain on java developers). Clearly those working on the JNI implementation would have both as would many core developers. But being able to build and run available tests using only one toolchain (e.g. either mvn and javac or cmake, make and gcc) would in my view be beneficial if we can find a good way to accommodate that. This is especially important for releases (but I think also nice for building from svn).

          Show
          Gordon Sim added a comment - Ideally I think you would not want to impose java's toolchain on C developers (or indeed C's toolchain on java developers). Clearly those working on the JNI implementation would have both as would many core developers. But being able to build and run available tests using only one toolchain (e.g. either mvn and javac or cmake, make and gcc) would in my view be beneficial if we can find a good way to accommodate that. This is especially important for releases (but I think also nice for building from svn).
          Hide
          Philip Harvey added a comment -

          Discussions on how to implement this JIRA are primarily on the Proton mailing list in the thread titled "Changing the Proton build system to accommodate jni bindings": http://mail-archives.apache.org/mod_mbox/qpid-proton/201301.mbox/browser

          Show
          Philip Harvey added a comment - Discussions on how to implement this JIRA are primarily on the Proton mailing list in the thread titled "Changing the Proton build system to accommodate jni bindings": http://mail-archives.apache.org/mod_mbox/qpid-proton/201301.mbox/browser
          Hide
          Keith Wall added a comment -

          The changes on the jni-branch are nearing completion. The changes with respect to current trunk are summarised below.

          • README/LICENSE files-

          README/LICENCE files have been moved to the proton level. The README has been updated to reflect the new practice.

          Building Proton-C

          Build is now performed from the parent (proton) directory rather than proton-c.
          If Cmake can find the JDK, proton-api and proton-jni will be built, otherwise they are skipped
          If Cmake can find** Bouncycastle JARs, proton-j-impl will be built, otherwise it is skipped.

          cd proton
          mkdir build
          cd build
          cmake ..
          ...

            • JAR search path is defined by Cmake's find_jar() function as /usr/share/java/ and /usr/local/share/java/. This can be supplemented on the command line via:

          cmake -DPROTON_JAR_DEPEND_DIR=... ..

          Testing Proton-C (Python tests)

          proton-test script and the Python tests have moved to accommodate tests written in other languages.

          cd proton
          . ./config.sh
          ./tests/python/proton-test

          Building Proton-J

          Build is now performed from the parent (proton) directory rather than proton-j.

          Typical maven commands:

          mvn compile -DskipTests # compile everything, skipping the tests
          mvn package # package everything

          Testing Proton-J/Proton-C via JNI bindings

          mvn test -Pproton-j # Run all system tests against proton-j
          mvn test -Pproton-jnj # Run all system tests against proton-c using jni wrappers ***
          mvn test -Pproton-j -Dproton.pythontest.pattern='proton_tests.transport.TransportTest.*' # Run Python tests matching patterm

              • you need to have previously built proton-c with the JNI bindings.
          Show
          Keith Wall added a comment - The changes on the jni-branch are nearing completion. The changes with respect to current trunk are summarised below. README/LICENSE files- README/LICENCE files have been moved to the proton level. The README has been updated to reflect the new practice. Building Proton-C Build is now performed from the parent (proton) directory rather than proton-c. If Cmake can find the JDK, proton-api and proton-jni will be built, otherwise they are skipped If Cmake can find** Bouncycastle JARs, proton-j-impl will be built, otherwise it is skipped. cd proton mkdir build cd build cmake .. ... JAR search path is defined by Cmake's find_jar() function as /usr/share/java/ and /usr/local/share/java/. This can be supplemented on the command line via: cmake -DPROTON_JAR_DEPEND_DIR=... .. Testing Proton-C (Python tests) proton-test script and the Python tests have moved to accommodate tests written in other languages. cd proton . ./config.sh ./tests/python/proton-test Building Proton-J Build is now performed from the parent (proton) directory rather than proton-j. Typical maven commands: mvn compile -DskipTests # compile everything, skipping the tests mvn package # package everything Testing Proton-J/Proton-C via JNI bindings mvn test -Pproton-j # Run all system tests against proton-j mvn test -Pproton-jnj # Run all system tests against proton-c using jni wrappers *** mvn test -Pproton-j -Dproton.pythontest.pattern='proton_tests.transport.TransportTest.*' # Run Python tests matching patterm you need to have previously built proton-c with the JNI bindings.
          Hide
          Philip Harvey added a comment -

          done

          Show
          Philip Harvey added a comment - done

            People

            • Assignee:
              Philip Harvey
              Reporter:
              Keith Wall
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development