Fixing #270763 - Move clang-tidy integration to nb contrib - move wrapper
authorIlia Gromov <ilia@netbeans.org>
Wed, 07 Jun 2017 14:01:11 +0300
changeset 18411b1f59000c10e
parent 18410 965f8fab9ed5
child 18412 1f98bfa6421f
Fixing #270763 - Move clang-tidy integration to nb contrib - move wrapper
c.oracle.tools.analysis.clangtidy.Linux_x86_64/build.xml
c.oracle.tools.analysis.clangtidy.Linux_x86_64/manifest.mf
c.oracle.tools.analysis.clangtidy.Linux_x86_64/nbproject/project.properties
c.oracle.tools.analysis.clangtidy.Linux_x86_64/nbproject/project.xml
c.oracle.tools.analysis.clangtidy.Linux_x86_64/src/com/oracle/tools/analysis/clangtidy/Linux_x86_64/Bundle.properties
c.oracle.tools.analysis.clangtidy.Linux_x86_64/src/com/oracle/tools/analysis/clangtidy/Linux_x86_64/LICENSE.TXT
clang-tidy.wrappers/post-build.sh
clang-tidy.wrappers/pre-build.sh
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/c.oracle.tools.analysis.clangtidy.Linux_x86_64/build.xml	Wed Jun 07 14:01:11 2017 +0300
     1.3 @@ -0,0 +1,8 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
     1.6 +<!-- for some information on what you could do (e.g. targets to override). -->
     1.7 +<!-- If you delete this file and reopen the project it will be recreated. -->
     1.8 +<project name="contrib/c.oracle.tools.analysis.clangtidy.Linux_x86_64" default="netbeans" basedir=".">
     1.9 +    <description>Builds, tests, and runs the project com.oracle.tools.analysis.clangtidy.Linux_x86_64.</description>
    1.10 +    <import file="../../nbbuild/templates/projectized.xml"/>
    1.11 +</project>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/c.oracle.tools.analysis.clangtidy.Linux_x86_64/manifest.mf	Wed Jun 07 14:01:11 2017 +0300
     2.3 @@ -0,0 +1,6 @@
     2.4 +Manifest-Version: 1.0
     2.5 +AutoUpdate-Show-In-Client: true
     2.6 +OpenIDE-Module: com.oracle.tools.analysis.clangtidy.Linux_x86_64
     2.7 +OpenIDE-Module-Localizing-Bundle: com/oracle/tools/analysis/clangtidy/Linux_x86_64/Bundle.properties
     2.8 +OpenIDE-Module-Specification-Version: 1.0.2
     2.9 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/c.oracle.tools.analysis.clangtidy.Linux_x86_64/nbproject/project.properties	Wed Jun 07 14:01:11 2017 +0300
     3.3 @@ -0,0 +1,7 @@
     3.4 +javac.source=1.7
     3.5 +javac.compilerargs=-Xlint -Xlint:-serial
     3.6 +license.file=src/com/oracle/tools/analysis/clangtidy/Linux_x86_64/LICENSE.TXT
     3.7 +nbm.executable.files=clang-tidy/**
     3.8 +nbm.homepage=http://clang.llvm.org/extra/clang-tidy/
     3.9 +nbm.module.author=Ilia Gromov
    3.10 +nbm.needs.restart=true
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/c.oracle.tools.analysis.clangtidy.Linux_x86_64/nbproject/project.xml	Wed Jun 07 14:01:11 2017 +0300
     4.3 @@ -0,0 +1,11 @@
     4.4 +<?xml version="1.0" encoding="UTF-8"?>
     4.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
     4.6 +    <type>org.netbeans.modules.apisupport.project</type>
     4.7 +    <configuration>
     4.8 +        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
     4.9 +            <code-name-base>com.oracle.tools.analysis.clangtidy.Linux_x86_64</code-name-base>
    4.10 +            <module-dependencies/>
    4.11 +            <public-packages/>
    4.12 +        </data>
    4.13 +    </configuration>
    4.14 +</project>
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/c.oracle.tools.analysis.clangtidy.Linux_x86_64/src/com/oracle/tools/analysis/clangtidy/Linux_x86_64/Bundle.properties	Wed Jun 07 14:01:11 2017 +0300
     5.3 @@ -0,0 +1,3 @@
     5.4 +OpenIDE-Module-Display-Category=Analysis tools
     5.5 +OpenIDE-Module-Name=Linux x86_64 clang-tidy
     5.6 +OpenIDE-Module-Short-Description=Bundled clang-tidy binaries for Linux x86-64
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/c.oracle.tools.analysis.clangtidy.Linux_x86_64/src/com/oracle/tools/analysis/clangtidy/Linux_x86_64/LICENSE.TXT	Wed Jun 07 14:01:11 2017 +0300
     6.3 @@ -0,0 +1,157 @@
     6.4 +==============================================================================
     6.5 +LLVM Release License
     6.6 +==============================================================================
     6.7 +University of Illinois/NCSA
     6.8 +Open Source License
     6.9 +
    6.10 +Copyright (c) 2003-2016 University of Illinois at Urbana-Champaign.
    6.11 +All rights reserved.
    6.12 +
    6.13 +Developed by:
    6.14 +
    6.15 +    LLVM Team
    6.16 +
    6.17 +    University of Illinois at Urbana-Champaign
    6.18 +
    6.19 +    http://llvm.org
    6.20 +
    6.21 +Permission is hereby granted, free of charge, to any person obtaining a copy of
    6.22 +this software and associated documentation files (the "Software"), to deal with
    6.23 +the Software without restriction, including without limitation the rights to
    6.24 +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
    6.25 +of the Software, and to permit persons to whom the Software is furnished to do
    6.26 +so, subject to the following conditions:
    6.27 +
    6.28 +    * Redistributions of source code must retain the above copyright notice,
    6.29 +      this list of conditions and the following disclaimers.
    6.30 +
    6.31 +    * Redistributions in binary form must reproduce the above copyright notice,
    6.32 +      this list of conditions and the following disclaimers in the
    6.33 +      documentation and/or other materials provided with the distribution.
    6.34 +
    6.35 +    * Neither the names of the LLVM Team, University of Illinois at
    6.36 +      Urbana-Champaign, nor the names of its contributors may be used to
    6.37 +      endorse or promote products derived from this Software without specific
    6.38 +      prior written permission.
    6.39 +
    6.40 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    6.41 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
    6.42 +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
    6.43 +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    6.44 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    6.45 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
    6.46 +SOFTWARE.
    6.47 +
    6.48 +==============================================================================
    6.49 +Copyrights and Licenses for Third Party Software Distributed with LLVM:
    6.50 +==============================================================================
    6.51 +The LLVM software contains code written by third parties.  Such software will
    6.52 +have its own individual LICENSE.TXT file in the directory in which it appears.
    6.53 +This file will describe the copyrights, license, and restrictions which apply
    6.54 +to that code.
    6.55 +
    6.56 +The disclaimer of warranty in the University of Illinois Open Source License
    6.57 +applies to all code in the LLVM Distribution, and nothing in any of the
    6.58 +other licenses gives permission to use the names of the LLVM Team or the
    6.59 +University of Illinois to endorse or promote products derived from this
    6.60 +Software.
    6.61 +
    6.62 +The following pieces of software have additional or alternate copyrights,
    6.63 +licenses, and/or restrictions:
    6.64 +
    6.65 +Program             Directory
    6.66 +-------             ---------
    6.67 +Autoconf            llvm/autoconf
    6.68 +                    llvm/projects/ModuleMaker/autoconf
    6.69 +Google Test         llvm/utils/unittest/googletest
    6.70 +OpenBSD regex       llvm/lib/Support/{reg*, COPYRIGHT.regex}
    6.71 +pyyaml tests        llvm/test/YAMLParser/{*.data, LICENSE.TXT}
    6.72 +ARM contributions   llvm/lib/Target/ARM/LICENSE.TXT
    6.73 +md5 contributions   llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h
    6.74 +
    6.75 +==============================================================================
    6.76 +LLVM Release License
    6.77 +==============================================================================
    6.78 +University of Illinois/NCSA
    6.79 +Open Source License
    6.80 +
    6.81 +Copyright (c) 2007-2016 University of Illinois at Urbana-Champaign.
    6.82 +All rights reserved.
    6.83 +
    6.84 +Developed by:
    6.85 +
    6.86 +    LLVM Team
    6.87 +
    6.88 +    University of Illinois at Urbana-Champaign
    6.89 +
    6.90 +    http://llvm.org
    6.91 +
    6.92 +Permission is hereby granted, free of charge, to any person obtaining a copy of
    6.93 +this software and associated documentation files (the "Software"), to deal with
    6.94 +the Software without restriction, including without limitation the rights to
    6.95 +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
    6.96 +of the Software, and to permit persons to whom the Software is furnished to do
    6.97 +so, subject to the following conditions:
    6.98 +
    6.99 +    * Redistributions of source code must retain the above copyright notice,
   6.100 +      this list of conditions and the following disclaimers.
   6.101 +
   6.102 +    * Redistributions in binary form must reproduce the above copyright notice,
   6.103 +      this list of conditions and the following disclaimers in the
   6.104 +      documentation and/or other materials provided with the distribution.
   6.105 +
   6.106 +    * Neither the names of the LLVM Team, University of Illinois at
   6.107 +      Urbana-Champaign, nor the names of its contributors may be used to
   6.108 +      endorse or promote products derived from this Software without specific
   6.109 +      prior written permission.
   6.110 +
   6.111 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   6.112 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
   6.113 +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
   6.114 +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   6.115 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   6.116 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
   6.117 +SOFTWARE.
   6.118 +
   6.119 +==============================================================================
   6.120 +The LLVM software contains code written by third parties.  Such software will
   6.121 +have its own individual LICENSE.TXT file in the directory in which it appears.
   6.122 +This file will describe the copyrights, license, and restrictions which apply
   6.123 +to that code.
   6.124 +
   6.125 +The disclaimer of warranty in the University of Illinois Open Source License
   6.126 +applies to all code in the LLVM Distribution, and nothing in any of the
   6.127 +other licenses gives permission to use the names of the LLVM Team or the
   6.128 +University of Illinois to endorse or promote products derived from this
   6.129 +Software.
   6.130 +
   6.131 +The following pieces of software have additional or alternate copyrights,
   6.132 +licenses, and/or restrictions:
   6.133 +
   6.134 +Program             Directory
   6.135 +-------             ---------
   6.136 +clang-tidy          clang-tidy/cert
   6.137 +
   6.138 +------------------------------------------------------------------------------
   6.139 +clang-tidy CERT Files
   6.140 +------------------------------------------------------------------------------
   6.141 +All clang-tidy files are licensed under the LLVM license with the following
   6.142 +additions:
   6.143 +
   6.144 +Any file referencing a CERT Secure Coding guideline:
   6.145 +Please allow this letter to serve as confirmation that open source projects on
   6.146 +http://llvm.org are permitted to link via hypertext to the CERT(R) secure coding
   6.147 +guidelines available at https://www.securecoding.cert.org.   
   6.148 +
   6.149 +The foregoing is permitted by the Terms of Use as follows:
   6.150 +"Linking to the Service
   6.151 +Because we update many of our Web documents regularly, we would prefer that you
   6.152 +link to our Web pages whenever possible rather than reproduce them. It is not
   6.153 +necessary to request permission to make referential hypertext links to The
   6.154 +Service."
   6.155 +http://www.sei.cmu.edu/legal/ip/index.cfm.
   6.156 +
   6.157 +Please allow this letter to also confirm that no formal permission is required
   6.158 +to reproduce the title of the content being linked to, nor to reproduce any
   6.159 +de Minimis description of such content.
   6.160 +
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/clang-tidy.wrappers/post-build.sh	Wed Jun 07 14:01:11 2017 +0300
     7.3 @@ -0,0 +1,49 @@
     7.4 +#!/bin/bash -x
     7.5 +
     7.6 +#
     7.7 +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
     7.8 +#
     7.9 +function add_module() {
    7.10 +    platform=$1
    7.11 +    unzip -q com-oracle-tools-analysis-clangtidy-${platform}.nbm Info/info.xml
    7.12 +#    cat Info/info.xml | egrep -e "<.?module|<.?manifest|<.?license" >> catalog.xml
    7.13 +    cat Info/info.xml | egrep -e "<.?module|<.?manifest" >> catalog.xml
    7.14 +    downlod_size=`ls -l com-oracle-tools-analysis-clangtidy-${platform}.nbm | awk '{print $5}'`
    7.15 +    sed -e "s|downloadsize=\"0\"|downloadsize=\"${downlod_size}\"|" catalog.xml > tmp
    7.16 +    sed -e "s|distribution=\"\"|distribution=\"com-oracle-tools-analysis-clangtidy-${platform}\.nbm\"|" tmp > catalog.xml
    7.17 +    rm -rf tmp
    7.18 +    rm -rf Info
    7.19 +}
    7.20 +
    7.21 +function add_modules_licence() {
    7.22 +    platform=$1
    7.23 +    unzip -q com-oracle-tools-analysis-clangtidy-${platform}.nbm Info/info.xml
    7.24 +    sed -e '/<license name/,/license>/!d' Info/info.xml >> catalog.xml
    7.25 +    rm -rf Info
    7.26 +}
    7.27 +
    7.28 +#upload="/net/everest/export1/sside/parfait/upload/"
    7.29 +export projects=$1
    7.30 +
    7.31 +#cp ${projects}/Linux_x86/build/com-oracle-tools-analysis-parfait-Linux_x86.nbm out/
    7.32 +cp ${projects}/Linux_x86_64/build/com-oracle-tools-analysis-clangtidy-Linux_x86_64.nbm out/
    7.33 +
    7.34 +cd out
    7.35 +timestamp=`date +%H/%M/%S/%m/%d/%Y`
    7.36 +
    7.37 +echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" > catalog.xml
    7.38 +echo "" >> catalog.xml
    7.39 +echo "<!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.6//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_6.dtd\">" >> catalog.xml
    7.40 +echo "<module_updates timestamp=\"${timestamp}\">" >> catalog.xml
    7.41 +echo '<module_group name="Oracle Developer Studio">' >> catalog.xml
    7.42 +
    7.43 +#add_module Linux_x86
    7.44 +add_module Linux_x86_64
    7.45 +
    7.46 +echo '</module_group>' >> catalog.xml
    7.47 +add_modules_licence Linux_x86_64
    7.48 +echo '</module_updates>' >> catalog.xml
    7.49 +cp catalog.xml catalog.xml.1
    7.50 +rm -f catalog.xml.gz
    7.51 +gzip catalog.xml
    7.52 +mv catalog.xml.1 catalog.xml
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/clang-tidy.wrappers/pre-build.sh	Wed Jun 07 14:01:11 2017 +0300
     8.3 @@ -0,0 +1,22 @@
     8.4 +#!/bin/bash -x
     8.5 +
     8.6 +export download_dir="$1"
     8.7 +export projects_dir="$2"
     8.8 +export netbeans="${projects_dir}/../../../netbeans"
     8.9 +export harness="${projects_dir}/../../../netbeans/harness"
    8.10 +
    8.11 +assemble() {
    8.12 +  local platform=$1
    8.13 +
    8.14 +  # erase contents of project's binary dir
    8.15 +  local project_bin="${projects_dir}/${platform}/release/clang-tidy"
    8.16 +  rm -rf   "$project_bin"
    8.17 +  mkdir -p "$project_bin"
    8.18 +
    8.19 +  cp "${download_dir}/clang-tidy-${platform}" "$project_bin"
    8.20 +
    8.21 +  ant -f ${projects_dir}/${platform} -Ddo.not.clean.module.config.xml=true -Dcontinue.after.failing.tests=true -Dnbplatform.NetBeans_IDE_CND_Dev.netbeans.dest.dir="$netbeans" -Dnbplatform.NetBeans_IDE_CND_Release.netbeans.dest.dir="$netbeans" -Dnbplatform.NetBeans_IDE_CND_Dev.harness.dir="$harness" -Dnbplatform.NetBeans_IDE_CND_Release.harness.dir="$harness" clean netbeans
    8.22 +  ant -f ${projects_dir}/${platform} -Dcontinue.after.failing.tests=true -Dnbplatform.NetBeans_IDE_CND_Dev.netbeans.dest.dir="$netbeans" -Dnbplatform.NetBeans_IDE_CND_Release.netbeans.dest.dir="$netbeans" -Dnbplatform.NetBeans_IDE_CND_Dev.harness.dir="$harness" -Dnbplatform.NetBeans_IDE_CND_Release.harness.dir="$harness" -Dkeystore=${WORKSPACE}/keystore/key.priv -Dnbm_alias=nb_ide -Dstorepass=ch0b0t7 nbm
    8.23 +}
    8.24 +
    8.25 +assemble "Linux_x86_64"