From 6898953b827f172e3da199c2c6878d7af9027347 Mon Sep 17 00:00:00 2001 From: Mick Semb Wever Date: Tue, 2 Apr 2019 20:01:39 +1100 Subject: [PATCH] Apache NetBeans project files patch by Mick Semb Wever ; reviewed by Wade Chandler and Dinesh Joshi for CASSANDRA-15073 --- .gitignore | 2 +- doc/source/development/ide.rst | 15 ++ ide/nbproject/jdk.xml | 157 +++++++++++++ ide/nbproject/nbjdk.properties | 1 + ide/nbproject/nbjdk.xml | 12 + ide/nbproject/project.properties | 23 ++ ide/nbproject/project.xml | 240 ++++++++++++++++++++ ide/nbproject/update-netbeans-classpaths.sh | 12 + 8 files changed, 461 insertions(+), 1 deletion(-) create mode 100644 ide/nbproject/jdk.xml create mode 100644 ide/nbproject/nbjdk.properties create mode 100644 ide/nbproject/nbjdk.xml create mode 100644 ide/nbproject/project.properties create mode 100644 ide/nbproject/project.xml create mode 100755 ide/nbproject/update-netbeans-classpaths.sh diff --git a/.gitignore b/.gitignore index d08471c31e..14bfe92478 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,7 @@ cscope.* # NetBeans nbbuild/ nbdist/ -nbproject/ +ide/nbproject/private nb-configuration.xml nbactions.xml diff --git a/doc/source/development/ide.rst b/doc/source/development/ide.rst index afe621dd54..b6da753643 100644 --- a/doc/source/development/ide.rst +++ b/doc/source/development/ide.rst @@ -72,6 +72,21 @@ The project generated by the ant task ``generate-idea-files`` contains nearly ev * Cassandra code style * Inspections +Opening Cassandra in Apache NetBeans +======================================= + +`Apache NetBeans `_ is the elder of the open sourced java IDEs, and can be used for Cassandra development. There is no project setup or generation required to open Cassandra in NetBeans. + +Open Cassandra as a Project (C* 4.0 and newer) +----------------------------------------------- + +Please clone and build Cassandra as described above and execute the following steps: + +1. Start Apache NetBeans + +2. Open the NetBeans project from the ``ide\` folder in the checked out (and built) Cassandra directory using the menu item "Open Project…" in NetBeans's File menu + + Setting up Cassandra in Eclipse =============================== diff --git a/ide/nbproject/jdk.xml b/ide/nbproject/jdk.xml new file mode 100644 index 0000000000..237e529b44 --- /dev/null +++ b/ide/nbproject/jdk.xml @@ -0,0 +1,157 @@ + + + + + Permits selection of a JDK to use when building and running project. + See: http://www.netbeans.org/issues/show_bug.cgi?id=64160 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + nbjdk.active=${nbjdk.active} nbjdk.home=${nbjdk.home} nbjdk.java=${nbjdk.java} nbjdk.javac=${nbjdk.javac} nbjdk.javadoc=${nbjdk.javadoc} nbjdk.bootclasspath=${nbjdk.bootclasspath} nbjdk.valid=${nbjdk.valid} have-jdk-1.4=${have-jdk-1.4} have-jdk-1.5=${have-jdk-1.5} + + + + + Warning: nbjdk.active=${nbjdk.active} or nbjdk.home=${nbjdk.home} is an invalid Java platform; ignoring and using ${jdkhome.presumed} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ide/nbproject/nbjdk.properties b/ide/nbproject/nbjdk.properties new file mode 100644 index 0000000000..2ac925db83 --- /dev/null +++ b/ide/nbproject/nbjdk.properties @@ -0,0 +1 @@ +nbjdk.active=JDK_1.8 diff --git a/ide/nbproject/nbjdk.xml b/ide/nbproject/nbjdk.xml new file mode 100644 index 0000000000..87439c592c --- /dev/null +++ b/ide/nbproject/nbjdk.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/ide/nbproject/project.properties b/ide/nbproject/project.properties new file mode 100644 index 0000000000..b06ebb7e62 --- /dev/null +++ b/ide/nbproject/project.properties @@ -0,0 +1,23 @@ +auxiliary.show.customizer=false +auxiliary.show.customizer.message=ide/nbproject/project.xml is to be edited by hand, ref: CASSANDRA-15073 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=4 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=4 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=4 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=110 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineMethodParams=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.enable-indent=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=java;com.google.common;org.apache.commons;org.junit;org.slf4j;* +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement=NEW_LINE +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.redundantDoWhileBraces=LEAVE_ALONE +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.redundantForBraces=LEAVE_ALONE +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.redundantIfBraces=LEAVE_ALONE +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.redundantWhileBraces=LEAVE_ALONE diff --git a/ide/nbproject/project.xml b/ide/nbproject/project.xml new file mode 100644 index 0000000000..d00f9421f8 --- /dev/null +++ b/ide/nbproject/project.xml @@ -0,0 +1,240 @@ + + + org.netbeans.modules.ant.freeform + + + apache-cassandra + + .. + + ${project.dir}/lib/HdrHistogram-2.1.9.jar:${project.dir}/lib/ST4-4.0.8.jar:${project.dir}/lib/airline-0.8.jar:${project.dir}/lib/antlr-runtime-3.5.2.jar:${project.dir}/lib/asm-6.2.jar:${project.dir}/lib/caffeine-2.3.5.jar:${project.dir}/lib/cassandra-driver-core-3.4.0-SNAPSHOT-shaded.jar:${project.dir}/lib/chronicle-bytes-1.16.3.jar:${project.dir}/lib/chronicle-core-1.16.3-SNAPSHOT.jar:${project.dir}/lib/chronicle-queue-4.16.3.jar:${project.dir}/lib/chronicle-threads-1.16.0.jar:${project.dir}/lib/chronicle-wire-1.16.1.jar:${project.dir}/lib/commons-cli-1.1.jar:${project.dir}/lib/commons-codec-1.9.jar:${project.dir}/lib/commons-lang3-3.1.jar:${project.dir}/lib/commons-math3-3.2.jar:${project.dir}/lib/concurrent-trees-2.4.0.jar:${project.dir}/lib/ecj-4.6.1.jar:${project.dir}/lib/guava-23.3-jre.jar:${project.dir}/lib/high-scale-lib-1.0.6.jar:${project.dir}/lib/hppc-0.5.4.jar:${project.dir}/lib/j2objc-annotations-1.3.jar:${project.dir}/lib/jackson-annotations-2.9.5.jar:${project.dir}/lib/jackson-core-2.9.5.jar:${project.dir}/lib/jackson-databind-2.9.5.jar:${project.dir}/lib/jamm-0.3.2.jar:${project.dir}/lib/javax.inject.jar:${project.dir}/lib/jbcrypt-0.3m.jar:${project.dir}/lib/jcl-over-slf4j-1.7.25.jar:${project.dir}/lib/jctools-core-1.2.1.jar:${project.dir}/lib/jflex-1.6.0.jar:${project.dir}/lib/jna-4.2.2.jar:${project.dir}/lib/joda-time-2.4.jar:${project.dir}/lib/json-simple-1.1.jar:${project.dir}/lib/jstackjunit-0.0.1.jar:${project.dir}/lib/log4j-over-slf4j-1.7.25.jar:${project.dir}/lib/logback-classic-1.2.3.jar:${project.dir}/lib/logback-core-1.2.3.jar:${project.dir}/lib/lz4-java-1.4.0.jar:${project.dir}/lib/metrics-core-3.1.5.jar:${project.dir}/lib/metrics-jvm-3.1.5.jar:${project.dir}/lib/metrics-logback-3.1.5.jar:${project.dir}/lib/netty-all-4.1.28.Final.jar:${project.dir}/lib/ohc-core-0.5.1.jar:${project.dir}/lib/ohc-core-j8-0.5.1.jar:${project.dir}/lib/psjava-0.1.19.jar:${project.dir}/lib/reporter-config-base-3.0.3.jar:${project.dir}/lib/reporter-config3-3.0.3.jar:${project.dir}/lib/sigar-1.6.4.jar:${project.dir}/lib/slf4j-api-1.7.25.jar:${project.dir}/lib/snakeyaml-1.11.jar:${project.dir}/lib/snappy-java-1.1.2.6.jar:${project.dir}/lib/snowball-stemmer-1.3.0.581.1.jar:${project.dir}/lib/stream-2.5.2.jar:${project.dir}/lib/zstd-jni-1.3.8-5.jar:${project.dir}/build/lib/jars/ST4-4.0.8.jar:${project.dir}/build/lib/jars/ant-1.9.7.jar:${project.dir}/build/lib/jars/ant-junit-1.9.7.jar:${project.dir}/build/lib/jars/ant-launcher-1.9.7.jar:${project.dir}/build/lib/jars/antlr-3.5.2.jar:${project.dir}/build/lib/jars/antlr-runtime-3.5.2.jar:${project.dir}/build/lib/jars/apache-rat-0.10.jar:${project.dir}/build/lib/jars/apache-rat-core-0.10.jar:${project.dir}/build/lib/jars/apache-rat-tasks-0.10.jar:${project.dir}/build/lib/jars/byteman-4.0.2.jar:${project.dir}/build/lib/jars/byteman-bmunit-4.0.2.jar:${project.dir}/build/lib/jars/byteman-install-4.0.2.jar:${project.dir}/build/lib/jars/byteman-submit-4.0.2.jar:${project.dir}/build/lib/jars/commons-beanutils-1.7.0.jar:${project.dir}/build/lib/jars/commons-beanutils-core-1.8.0.jar:${project.dir}/build/lib/jars/commons-cli-1.2.jar:${project.dir}/build/lib/jars/commons-codec-1.4.jar:${project.dir}/build/lib/jars/commons-collections-3.2.1.jar:${project.dir}/build/lib/jars/commons-compress-1.5.jar:${project.dir}/build/lib/jars/commons-configuration-1.6.jar:${project.dir}/build/lib/jars/commons-digester-1.8.jar:${project.dir}/build/lib/jars/commons-el-1.0.jar:${project.dir}/build/lib/jars/commons-httpclient-3.0.1.jar:${project.dir}/build/lib/jars/commons-io-2.2.jar:${project.dir}/build/lib/jars/commons-lang-2.4.jar:${project.dir}/build/lib/jars/commons-math-2.1.jar:${project.dir}/build/lib/jars/commons-math3-3.2.jar:${project.dir}/build/lib/jars/commons-net-1.4.1.jar:${project.dir}/build/lib/jars/compile-command-annotations-1.2.0.jar:${project.dir}/build/lib/jars/ecj-4.6.1.jar:${project.dir}/build/lib/jars/ftplet-api-1.0.0.jar:${project.dir}/build/lib/jars/ftpserver-core-1.0.0.jar:${project.dir}/build/lib/jars/ftpserver-deprecated-1.0.0-M2.jar:${project.dir}/build/lib/jars/guava-16.0.jar:${project.dir}/build/lib/jars/hadoop-core-1.0.3.jar:${project.dir}/build/lib/jars/hadoop-minicluster-1.0.3.jar:${project.dir}/build/lib/jars/hadoop-test-1.0.3.jar:${project.dir}/build/lib/jars/hamcrest-core-1.3.jar:${project.dir}/build/lib/jars/hsqldb-1.8.0.10.jar:${project.dir}/build/lib/jars/jackson-core-asl-1.0.1.jar:${project.dir}/build/lib/jars/jackson-mapper-asl-1.0.1.jar:${project.dir}/build/lib/jars/jacocoagent.jar:${project.dir}/build/lib/jars/jasper-compiler-5.5.12.jar:${project.dir}/build/lib/jars/jasper-runtime-5.5.12.jar:${project.dir}/build/lib/jars/jersey-core-1.0.jar:${project.dir}/build/lib/jars/jersey-server-1.0.jar:${project.dir}/build/lib/jars/jets3t-0.7.1.jar:${project.dir}/build/lib/jars/jetty-6.1.26.jar:${project.dir}/build/lib/jars/jetty-util-6.1.26.jar:${project.dir}/build/lib/jars/jmh-core-1.21.jar:${project.dir}/build/lib/jars/jmh-generator-annprocess-1.21.jar:${project.dir}/build/lib/jars/jna-4.1.0.jar:${project.dir}/build/lib/jars/jopt-simple-4.6.jar:${project.dir}/build/lib/jars/jsp-2.1-6.1.14.jar:${project.dir}/build/lib/jars/jsp-api-2.1-6.1.14.jar:${project.dir}/build/lib/jars/jsr305-2.0.2.jar:${project.dir}/build/lib/jars/jsr311-api-1.0.jar:${project.dir}/build/lib/jars/junit-4.12.jar:${project.dir}/build/lib/jars/kfs-0.3.jar:${project.dir}/build/lib/jars/mina-core-2.0.0-M5.jar:${project.dir}/build/lib/jars/ohc-core-0.5.1.jar:${project.dir}/build/lib/jars/ohc-core-j8-0.5.1.jar:${project.dir}/build/lib/jars/org.jacoco.agent-0.7.5.201505241946.jar:${project.dir}/build/lib/jars/org.jacoco.ant-0.7.5.201505241946.jar:${project.dir}/build/lib/jars/org.jacoco.core-0.7.5.201505241946.jar:${project.dir}/build/lib/jars/org.jacoco.report-0.7.5.201505241946.jar:${project.dir}/build/lib/jars/oro-2.0.8.jar:${project.dir}/build/lib/jars/psjava-0.1.19.jar:${project.dir}/build/lib/jars/quicktheories-0.25.jar:${project.dir}/build/lib/jars/servlet-api-2.5-6.1.14.jar:${project.dir}/build/lib/jars/xmlenc-0.52.jar: + + + + + java + ${project.dir}/src/gen-java + UTF-8 + + + + java + ${project.dir}/src/java + UTF-8 + + + + java + ${project.dir}/tools/fqltool/src + UTF-8 + + + + java + ${project.dir}/tools/stress/src + UTF-8 + + + + java + ${project.dir}/test/unit + UTF-8 + + + + java + ${project.dir}/tools/fqltool/test/unit + UTF-8 + + + + java + ${project.dir}/tools/stress/test/unit + UTF-8 + + + + java + ${project.dir}/test/distributed + UTF-8 + + + + java + ${project.dir}/test/burn + UTF-8 + + + + java + ${project.dir}/test/long + UTF-8 + + + + java + ${project.dir}/test/microbench + UTF-8 + + + + ${project.dir} + UTF-8 + + + + + + build + + + + clean + + + + clean + build + + + + folder + ${project.dir}/build/classes/main + + build + + + folder + ${project.dir}/build/classes/fqltool + + build + + + folder + ${project.dir}/build/classes/stress + + build + + + folder + ${project.dir}/build/test/classes + + build + + + folder + ${project.dir}/build/test/fqltool-classes + + build + + + folder + ${project.dir}/build/test/stress-classes + + build + + + + + + ${project.dir}/src/gen-java + + + + ${project.dir}/src/java + + + + ${project.dir}/tools/fqltool/src + + + + ${project.dir}/tools/stress/src + + + + ${project.dir}/test/unit + + + + ${project.dir}/tools/fqltool/test/unit + + + + ${project.dir}/tools/stress/test/unit + + + + ${project.dir}/test/distributed + + + + ${project.dir}/test/burn + + + + ${project.dir}/test/long + + + + ${project.dir}/test/microbench + + + ${project.dir}/build.xml + + + + + + + + + + + + ${project.dir}/src/gen-java + ${project.dir}/src/java + ${cassandra.classpath.jars} + ${project.dir}/build/classes/main + 1.8 + + + ${project.dir}/tools/fqltool/src + ${cassandra.classpath.jars}:${project.dir}/build/classes/main + ${project.dir}/build/classes/fqltool + 1.8 + + + ${project.dir}/tools/stress/src + ${cassandra.classpath.jars}:${project.dir}/build/classes/main + ${project.dir}/build/classes/stress + 1.8 + + + ${project.dir}/test/unit + ${project.dir}/test/distributed + ${project.dir}/test/long + ${project.dir}/test/microbench + ${project.dir}/test/burn + + ${cassandra.classpath.jars}:${project.dir}/build/classes/main:${project.dir}/build/classes/fqltool/:${project.dir}/build/classes/stress/ + ${project.dir}/build/test/classes + 1.8 + + + ${project.dir}/tools/fqltool/test/unit + + ${cassandra.classpath.jars}:${project.dir}/build/classes/main:${project.dir}/build/classes/fqltool/ + ${project.dir}/build/test/fqltool-classes + 1.8 + + + ${project.dir}/tools/stress/test/unit + + ${cassandra.classpath.jars}:${project.dir}/build/classes/main:${project.dir}/build/classes/stress/ + ${project.dir}/build/test/stress-classes + 1.8 + + + + diff --git a/ide/nbproject/update-netbeans-classpaths.sh b/ide/nbproject/update-netbeans-classpaths.sh new file mode 100755 index 0000000000..8d1ba00cb0 --- /dev/null +++ b/ide/nbproject/update-netbeans-classpaths.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# +# Update the classpaths elements in the project.xml found in the same directory +# Works around the lack of wildcarded classpaths in netbeans freeform projects +# ref: https://netbeans.org/bugzilla/show_bug.cgi?id=116185 +# + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +CLASSPATH=`for f in lib/*.jar ; do echo -n '${project.dir}/'$f: ; done ; for f in build/lib/jars/*.jar ; do echo -n '${project.dir}/'$f: ; done ;` + +sed -i '' 's/cassandra\.classpath\.jars\">.*<\/property>/cassandra\.classpath\.jars\">NEW_CLASSPATH<\/property>/' $DIR/project.xml +sed -i '' "s@NEW_CLASSPATH@"$CLASSPATH"@" $DIR/project.xml