Changeset 23776


Ignore:
Timestamp:
Apr 9, 2007, 5:59:42 PM (12 years ago)
Author:
landonf@…
Message:

The PMD port wasn't working; this commit:

  • Uses the included .jar dependencies
  • Fixes the bin/pmd script to pass arguments directly to pmd
  • Does not attempt to depend on kaffe (unusable).
  • Claims ownership (plus openmaintainer)
Location:
trunk/dports/java/pmd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/java/pmd/Portfile

    r22478 r23776  
    88categories       java lang
    99platforms        darwin
    10 maintainers      nomaintainer@macports.org
     10maintainers      landonf@macports.org openmaintainer@macports.org
    1111
    1212description      PMD is a Java source code analyzer
     
    2222
    2323depends_build    bin:ant:apache-ant
    24 depends_lib      bin:java:kaffe
    25 depends_run      port:jaxen \
    26                  port:xercesj \
    27                  port:saxpath \
    28                  port:junit
    2924
    3025worksrcdir       ${name}-${version}
    3126
    3227post-extract   {
    33    file delete ${worksrcpath}/lib/saxpath-1.0-fcs.jar \
    34       ${worksrcpath}/lib/xercesImpl-2.0.2.jar \
    35       ${worksrcpath}/lib/xmlParserAPIs-2.0.2.jar \
    36       ${worksrcpath}/lib/jaxen-core-1.0-fcs.jar \
    37       ${worksrcpath}/lib/pmd-2.0.jar
     28    # Ensure this gets rebuilt
     29    file delete ${worksrcpath}/lib/pmd-${version}.jar
    3830}
    3931
     
    4133
    4234build.cmd      ant
    43 build.target   jar
     35build.target   dist
    4436build.dir      ${worksrcpath}/bin
    45 build.env      CLASSPATH=${prefix}/share/java/junit.jar:${prefix}/share/java/saxpath.jar:${prefix}/share/java/xercesImpl.jar:${prefix}/share/java/xml-apis.jar:${prefix}/share/java/jaxen.jar
    4637
    4738destroot {
    48    xinstall -m 755 ${filespath}/pmd ${destroot}${prefix}/bin
    49    reinplace "s|_PREFIX_|${prefix}|g" ${destroot}${prefix}/bin/pmd
    50    xinstall -m 755 -d ${destroot}${prefix}/share/java \
    51       ${destroot}${prefix}/share/doc
    52    xinstall -m 644 ${worksrcpath}/lib/pmd-${version}.jar \
    53       ${destroot}${prefix}/share/java/pmd.jar
    54    file copy ${worksrcpath}/docs ${destroot}${prefix}/share/doc/${name}
    55    file copy ${worksrcpath}/rulesets ${destroot}${prefix}/share/${name}
     39    # Install the wrapper script
     40    xinstall -m 755 ${filespath}/pmd ${destroot}${prefix}/bin
     41    reinplace "s|_PREFIX_|${prefix}|g" ${destroot}${prefix}/bin/pmd
     42
     43    # Install jars
     44    xinstall -m 755 -d ${destroot}${prefix}/share/pmd
     45    file copy ${worksrcpath}/rulesets ${destroot}${prefix}/share/pmd
     46    foreach file [glob ${worksrcpath}/lib/*.jar] {
     47        xinstall -m 644 ${file} ${destroot}${prefix}/share/pmd/
     48    }
     49    system "cd ${destroot}${prefix}/share/pmd && ln -s pmd-${version}.jar pmd.jar"
     50
     51    # Install documentation
     52    xinstall -m 755 -d ${destroot}${prefix}/share/doc/pmd
     53    file copy ${worksrcpath}/docs ${destroot}${prefix}/share/doc/pmd
    5654}
  • trunk/dports/java/pmd/files/pmd

    r8648 r23776  
    11#!/bin/sh
    22PREFIX=_PREFIX_
    3 if [ $# -ne 3 ]; then
    4         echo "Usage $0 source.java format rule"
    5         echo " format: html, text, xml"
    6         echo " rules: basic, braces, clone, codesize, controversial, coupling, design, favorites, finalizers, imports, javabeans, junit, naming, newrules, scratchpad, strictexception, strings, unusedcode"
    7 else
    8         RULE=${PREFIX}/share/pmd/${3}.xml
    9         java -classpath ${PREFIX}/share/java/xml-apis.jar:${PREFIX}/share/java/xercesImpl.jar:${PREFIX}/share/java/saxpath.jar:${PREFIX}/share/java/jaxen-core.jar:${PREFIX}/share/java/pmd.jar net.sourceforge.pmd.PMD $1 $2 ${RULE}
    10 fi
    113
     4java -jar ${PREFIX}/share/pmd/pmd.jar "$@"
Note: See TracChangeset for help on using the changeset viewer.