build jamonapi-jamon

Julien LepillerThu Sep 13 20:28:45+0200 2018

6c888e2

build jamonapi-jamon

more/packages/java.scm

178178
       (modify-phases %standard-phases
179179
         (add-before 'build 'copy-resources
180180
           (lambda _
181-
             (copy-recursively "src/main/resources" "build/classes")))
181+
             (copy-recursively "src/main/resources" "build/classes")
182+
             #t))
182183
         (add-before 'build 'remove-failing-test
183184
           (lambda _
184185
             ;; This file fails to build

399400
       (modify-phases %standard-phases
400401
         (add-before 'build 'copy-resources
401402
           (lambda _
402-
             (copy-recursively "japicmp/src/main/resources" "build/classes"))))))
403+
             (copy-recursively "japicmp/src/main/resources" "build/classes")
404+
             #t)))))
403405
    (inputs
404406
     `(("java-airline" ,java-airline)
405407
       ("java-jboss-javassist" ,java-jboss-javassist)

17781780
    (description "")
17791781
    (license license:expat)))
17801782
1781-
(define-public java-aws
1782-
  (package
1783-
    (name "java-aws")
1784-
    (version "1.11.407")
1785-
    (source (origin
1786-
              (method url-fetch)
1787-
              (uri (string-append "https://github.com/aws/aws-sdk-java/archive/"
1788-
                                  version ".tar.gz"))
1789-
              (sha256
1790-
               (base32
1791-
                "0vn6mhblhnbfncz3a8wl1fmivjkzv7hf67a2xqlzb2wzjdhxr6r4"))))
1792-
    (build-system ant-build-system)
1793-
    (home-page "")
1794-
    (synopsis "")
1795-
    (description "")
1796-
    (license license:asl2.0)))
1797-
1798-
(define java-hazelcast-client-protocol-version "1.7.0-3")
17991783
(define java-hazelcast-version "3.10.4")
1784+
;; Required versions are described in pom.xml and hazelcast-client/pom.xml in
1785+
;; the hazelcast tarball.
1786+
(define java-hazelcast-client-protocol-version "1.6.0")
1787+
(define java-hazelcast-aws-version "2.0.0")
18001788
18011789
(define java-hazelcast-client-protocol-source
18021790
  (origin

18071795
    (file-name (string-append "hazelcast-client-protocol-" java-hazelcast-client-protocol-version ".tar.gz"))
18081796
    (sha256
18091797
     (base32
1810-
      "091j9as0zsm4rldj4x605hh0rmiwly39y0kg8zi6c2rkabzp2qpb"))))
1798+
      "0snd5cyjgg007nfhhsv2w0n3jybblbcjmpf3qpy4x4m38729gly8"))))
18111799
18121800
(define java-hazelcast-source
18131801
  (origin

18191807
     (base32
18201808
      "0bmhjh15xcqc4k77ncfw60b0gfnh6ndc3rr8am09ys8yga4w59hf"))))
18211809
1810+
(define java-hazelcast-aws-source
1811+
  (origin
1812+
    (method url-fetch)
1813+
    (uri (string-append "https://github.com/hazelcast/hazelcast-aws/"
1814+
                        "archive/v" java-hazelcast-aws-version ".tar.gz"))
1815+
    (file-name (string-append "java-hazelcast-aws-" java-hazelcast-aws-version ".tar.gz"))
1816+
    (sha256
1817+
     (base32
1818+
      "0hdih6b4rvcflxn2c3wbn8a6aw13bb0nwmifyi118wr6cqrlv02p"))))
1819+
18221820
(define-public java-hazelcast-code-generator
18231821
  (package
18241822
    (name "java-hazelcast-code-generator")

18711869
       #:source-dir
18721870
       (string-append "hazelcast-client/src/main/java:hazelcast/src/main/java:"
18731871
                      "hazelcast-client-protocol-" ,java-hazelcast-client-protocol-version
1874-
                      "/hazelcast/src/main/java")
1872+
                      "/hazelcast/src/main/java:hazelcast-aws-" ,java-hazelcast-aws-version
1873+
                      "/src/main/java")
18751874
       #:tests? #f
18761875
       #:phases
18771876
       (modify-phases %standard-phases

18851884
</javac>")
18861885
               (("<javac") "<javac source=\"1.6\""))
18871886
             #t))
1887+
         (add-before 'build 'unpack-aws
1888+
           (lambda* (#:key inputs #:allow-other-keys)
1889+
             (invoke "tar" "xzf" (assoc-ref inputs "java-hazelcast-aws-source"))
1890+
             #t))
1891+
         (add-before 'build 'unpack-client-protocol
1892+
           (lambda* (#:key inputs #:allow-other-keys)
1893+
             (invoke "tar" "xzf" (assoc-ref inputs "java-hazelcast-client-protocol-source"))
1894+
             #t))
18881895
         (add-before 'build 'fix-renamed-dependencies
18891896
           (lambda _
18901897
             (substitute* '("hazelcast-client/src/main/java/com/hazelcast/client/spi/impl/AwsAddressProvider.java"
1891-
                            "hazelcast-client/src/main/java/com/hazelcast/client/spi/impl/discovery/HazelcastCloudDiscovery.java")
1898+
                            "hazelcast-client/src/main/java/com/hazelcast/client/spi/impl/discovery/HazelcastCloudDiscovery.java"
1899+
                            "hazelcast-aws-2.0.0/src/main/java/com/hazelcast/aws/impl/DescribeInstances.java")
18921900
               (("com.hazelcast.com.eclipsesource.json") "com.eclipsesource.json"))
1893-
             (substitute* "hazelcast-client/src/main/java/com/hazelcast/client/spi/impl/AwsAddressProvider.java"
1894-
               (("com.hazelcast.aws.AWSClient") "aws.AWSClient"))
18951901
             #t))
1896-
         (add-before 'build 'unpack-client-protocol
1897-
           (lambda* (#:key inputs #:allow-other-keys)
1898-
             (display (assoc-ref inputs "java-hazelcast-client-protocol-source"))
1899-
             (newline)
1900-
             (invoke "tar" "xzf" (assoc-ref inputs "java-hazelcast-client-protocol-source"))
1902+
         (add-before 'build 'copy-template
1903+
           (lambda _
1904+
             (with-directory-excursion "hazelcast/src/main"
1905+
               (copy-file "template/com/hazelcast/instance/GeneratedBuildProperties.java"
1906+
                            "java/com/hazelcast/instance/GeneratedBuildProperties.java")
1907+
               (substitute* "java/com/hazelcast/instance/GeneratedBuildProperties.java"
1908+
                 (("\\$\\{project.version\\}") ,version)
1909+
                 (("\\$\\{timestamp\\}") "0")
1910+
                 (("\\$\\{git.commit.id.abbrev\\}") "0f51fcf")
1911+
                 (("\\$\\{hazelcast.distribution\\}") "Hazelcast")
1912+
                 (("\\$\\{hazelcast.serialization.version\\}") "1")))
19011913
             #t))
19021914
         (add-before 'build 'remove-package-info
19031915
           (lambda _

19061918
    (inputs
19071919
     `(("java-commons-logging-minimal" ,java-commons-logging-minimal)
19081920
       ("java-apache-freemarker" ,java-apache-freemarker)
1921+
       ("java-hazelcast-aws-source" ,java-hazelcast-aws-source)
19091922
       ("java-hazelcast-code-generator" ,java-hazelcast-code-generator)
19101923
       ("java-hazelcast-client-protocol-source" ,java-hazelcast-client-protocol-source)
19111924
       ("java-jsr107" ,java-jsr107)
19121925
       ("java-jsr305" ,java-jsr305)
1913-
       ("java-log4j-1.2-api" ,java-log4j-1.2-api)
1926+
       ("java-log4j-1.2" ,java-log4j-1.2)
19141927
       ("java-log4j-api" ,java-log4j-api)
19151928
       ("java-minimal-json" ,java-minimal-json)
19161929
       ("java-osgi-core" ,java-osgi-core)

19681981
              (file-name (string-append name "-" version ".tar.gz"))
19691982
              (sha256
19701983
               (base32
1971-
                "0kh0p1h546k6myd268jlr681bx15q6ip15an56rmqdw4q87xk23v"))))
1984+
                "0kh0p1h546k6myd268jlr681bx15q6ip15an56rmqdw4q87xk23v"))
1985+
              (patches
1986+
                (search-patches "java-jamonapi-jamon-update-dependencies.patch"))))
19721987
    (build-system ant-build-system)
19731988
    (arguments
19741989
     `(#:jar-name "java-jamonapi-jamon.jar"
19751990
       #:source-dir "jamon/src/main/java"
19761991
       #:test-dir "jamon/src/test"
1992+
       #:test-exclude
1993+
       (list
1994+
         "**/Abstract*.java"
1995+
         ;; Fail to parse hazelcast.xml
1996+
         "**/DistributedJamonHazelcastTest.java"
1997+
         "**/JamonDataPersisterFactoryTest.java"
1998+
         ;; javax.management.InstanceAlreadyExistsException
1999+
         "**/JmxUtilsTest.java"
2000+
         ;; Missing hsqldb as a dependency
2001+
         "**/MonProxyTest.java")
19772002
       #:jdk ,icedtea-8
19782003
       #:phases
19792004
       (modify-phases %standard-phases

19822007
             ;; Classes in this directory depend on spring-framework-context,
19832008
             ;; which depends on spring-framework-aop which depends on jamonapi.
19842009
             (delete-file-recursively "jamon/src/main/java/com/jamonapi/aop")
1985-
             #t))
1986-
         (add-before 'build 'port-to-jetty9
1987-
           (lambda _
1988-
             (substitute* "jamon/src/main/java/com/jamonapi/http/JettyHttpMonItem.java"
1989-
               (("org.mortbay.jetty.Request")
1990-
                "org.eclipse.jetty.server.Request"))
1991-
             (substitute* "jamon/src/main/java/com/jamonapi/http/JAMonJettyHandler.java"
1992-
               (("org.mortbay.jetty.Request")
1993-
                "org.eclipse.jetty.server.Request")
1994-
               (("org.mortbay.jetty.Response")
1995-
                "org.eclipse.jetty.server.Response")
1996-
               (("org.mortbay.jetty.HttpConnection")
1997-
                "org.eclipse.jetty.server.HttpConnection")
1998-
               (("org.mortbay.jetty.handler.HandlerWrapper")
1999-
                "org.eclipse.jetty.server.handler.HandlerWrapper"))
2010+
             (delete-file-recursively "jamon/src/test/java/com/jamonapi/aop")
20002011
             #t)))))
20012012
    (inputs
20022013
     `(("java-aspectj-rt" ,java-aspectj-rt)
2014+
       ("java-eclipse-jetty-io" ,java-eclipse-jetty-io)
20032015
       ("java-eclipse-jetty-server" ,java-eclipse-jetty-server)
2016+
       ("java-eclipse-jetty-util" ,java-eclipse-jetty-util)
2017+
       ("java-hazelcast-bootstrap" ,java-hazelcast-bootstrap)
20042018
       ;("java-javaee-servletapi" ,java-javaee-servletapi)
20052019
       ("java-tomcat" ,java-tomcat) ; for catalina and servletapi
2006-
       ("java-log4j-api" ,java-log4j-api)))
2020+
       ("java-log4j-api" ,java-log4j-api)
2021+
       ("java-log4j-1.2" ,java-log4j-1.2)))
2022+
    (native-inputs
2023+
     `(("java-asm" ,java-asm)
2024+
       ("java-assertj" ,java-assertj)
2025+
       ("java-cglib" ,java-cglib)
2026+
       ("java-hamcrest-core" ,java-hamcrest-core)
2027+
       ("java-jboss-interceptors-api-spec" ,java-jboss-interceptors-api-spec)
2028+
       ("java-junit" ,java-junit)
2029+
       ("java-mockito-1" ,java-mockito-1)
2030+
       ("java-objenesis" ,java-objenesis)))
20072031
    (home-page "")
20082032
    (synopsis "")
20092033
    (description "")

22162240
       ("java-snakeyaml" ,java-snakeyaml)
22172241
       ("java-spring-framework-beans" ,java-spring-framework-beans)
22182242
       ("java-spring-framework-core" ,java-spring-framework-core)
2243+
       ("java-jamonapi-jamon-bootstrap" ,java-jamonapi-jamon-bootstrap)
22192244
       ;; Note: for javax-el (el-api)
22202245
       ("java-tomcat" ,java-tomcat)))
22212246
    (description "")))

22732298
       ("java-commons-logging-minimal" ,java-commons-logging-minimal)
22742299
       ("java-javax-inject" ,java-javax-inject)
22752300
       ("java-snakeyaml" ,java-snakeyaml)
2301+
       ("java-spring-framework-aop" ,java-spring-framework-aop)
22762302
       ("java-spring-framework-beans" ,java-spring-framework-beans)
22772303
       ("java-spring-framework-core" ,java-spring-framework-core)
22782304
       ;; Note: for javax-el (el-api)

43944420
               (chmod (string-append bin "/antlr4") #o755))))
43954421
         (add-before 'build 'copy-resources
43964422
           (lambda _
4397-
             (copy-recursively "tool/resources/" "build/classes")))
4423+
             (copy-recursively "tool/resources/" "build/classes")
4424+
             #t))
43984425
         (add-before 'build 'generate-unicode
43994426
           (lambda _
44004427
             (and