aboutsummaryrefslogtreecommitdiff
path: root/databases/cassandra4/files/patch-build.xml
blob: 260d784805f8cb6d965de66fb4c7bd419866e44f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
--- build.xml.orig	2022-07-12 10:18:13 UTC
+++ build.xml
@@ -31,6 +31,7 @@
     <property file="build.properties" />
     <property file="build.properties.default" />
     <property name="debuglevel" value="source,lines,vars"/>
+    <property name="pycmd" value="python"/>
 
     <!-- default version and SCM information -->
     <property name="base.version" value="4.0.5"/>
@@ -81,7 +82,7 @@
     <condition property="version" value="${base.version}">
       <isset property="release"/>
     </condition>
-    <property name="version" value="${base.version}-SNAPSHOT"/>
+    <property name="version" value="${base.version}"/>
     <property name="version.properties.dir"
               value="${build.src.resources}/org/apache/cassandra/config/" />
     <property name="final.name" value="${ant.project.name}-${version}"/>
@@ -288,6 +289,24 @@
             <exclude name="**/ant-*.jar"/>
         </fileset>
     </path>
+    <path id="cassandra.classpath.staged">
+        <file file="${build.dir}/${final.name}.jar"/> <!-- we need the jar for tests and benchmarks (multi-version jar) -->
+        <fileset dir="${stagedlib}">
+            <include name="**/*.jar" />
+        </fileset>
+        <fileset dir="${build.dir.lib}">
+            <include name="**/assertj-core-3.15.0.jar" />
+            <include name="**/byteman*.jar" />
+            <include name="**/commons-lang-2.4.jar" />
+            <include name="**/commons-collections-3.2.1.jar" />
+            <include name="**/ohc-core-0.5.1.jar" />
+            <include name="**/ohc-core-j8-0.5.1.jar" />
+        </fileset>
+        <fileset dir="${test.lib}/jars">
+            <include name="**/*.jar" />
+            <exclude name="**/ant-*.jar"/>
+        </fileset>
+    </path>
 
   <macrodef name="create-javadoc">
     <attribute name="destdir"/>
@@ -297,7 +316,7 @@
         windowtitle="${ant.project.name} API" classpathref="cassandra.classpath"
         bottom="Copyright &amp;copy; 2009-2022 The Apache Software Foundation"
         useexternalfile="yes" encoding="UTF-8" failonerror="false"
-        maxmemory="256m" additionalparam="${jdk11-javadoc-exports}">
+        maxmemory="512m" additionalparam="${jdk11-javadoc-exports}">
         <filesets/>
       </javadoc>
       <fail message="javadoc failed">
@@ -438,6 +457,8 @@
     <target name="gen-doc" description="Generate documentation" depends="gen-asciidoc,generate-cql-html" unless="ant.gen-doc.skip">
         <exec executable="make" osfamily="unix" dir="${doc.dir}">
             <arg value="html"/>
+            <arg value="PYTHON_CMD=${pycmd}"/>
+            <arg value="PYTHON_VER=${pyver}"/>
         </exec>
     </target>
 
@@ -896,7 +917,7 @@
         </javac>
     </target>
 
-    <target depends="init,gen-cql3-grammar,generate-cql-html,generate-jflex-java,rat-check"
+    <target depends="init,gen-cql3-grammar,generate-cql-html,generate-jflex-java"
             name="build-project">
         <echo message="${ant.project.name}: ${ant.file}"/>
         <!-- Order matters! -->
@@ -1147,6 +1168,89 @@
       </copy>
     </target>
 
+    <!-- FreeBSD for staging -->
+    <target name="freebsd-stage" depends="jar"
+            description="Create Cassandra directory structure for staging">
+      <mkdir dir="${dist.dir}"/>
+      <copy todir="${dist.dir}/lib">
+        <fileset dir="${build.lib}">
+          <exclude name="sigar*.jar"/>
+          <exclude name="sigar-bin/*"/>
+          <exclude name="snappy*.jar"/>
+          <exclude name="netty-all*.jar"/>
+          <exclude name="ohc*.jar"/>
+          <exclude name="licenses/snappy*.txt"/>
+          <exclude name="licenses/netty-all*.txt"/>
+          <exclude name="licenses/ohc*.txt"/>
+        </fileset>
+        <fileset dir="${build.dir}">
+          <include name="${final.name}.jar" />
+        </fileset>
+      </copy>
+      <copy todir="${dist.dir}/bin">
+        <fileset dir="bin">
+	  <exclude name="*.bat" />
+	  <exclude name="*.ps1" />
+	  <exclude name="*.orig" />
+	</fileset>
+      </copy>
+      <copy todir="${dist.dir}/conf">
+        <fileset dir="conf">
+          <exclude name="*.ps1" />
+	  <exclude name="*.orig" />
+        </fileset>
+      </copy>
+      <copy todir="${dist.dir}/pylib">
+        <fileset dir="pylib">
+          <include name="**" />
+          <exclude name="**/*.pyc" />
+          <exclude name="Dockerfile.ubuntu.*" />
+          <exclude name="cqlshlib/test/**" />
+          <exclude name="cassandra-cqlsh-tests.sh" />
+        </fileset>
+      </copy>
+      <copy todir="${dist.dir}/">
+        <fileset dir="${basedir}">
+          <include name="*.txt" />
+        </fileset>
+      </copy>
+      <copy todir="${dist.dir}/tools/bin">
+        <fileset dir="${basedir}/tools/bin">
+          <exclude name="*.bat" />
+          <exclude name="*.ps1" />
+	  <exclude name="*.orig" />
+        </fileset>
+      </copy>
+      <copy todir="${dist.dir}/tools/">
+        <fileset dir="${basedir}/tools/">
+            <include name="*.yaml"/>
+	</fileset>
+      </copy>
+      <copy todir="${dist.dir}/tools/lib">
+        <fileset dir="${build.dir}/tools/lib/">
+            <include name="*.jar" />
+        </fileset>
+      </copy>
+    </target>
+
+    <target name="freebsd-stage-doc" depends="freebsd-stage,javadoc,gen-doc"
+            description="Create Cassandra directory structure for staging, including docs">
+      <copy todir="${dist.dir}/javadoc">
+        <fileset dir="${javadoc.dir}"/>
+      </copy>
+      <copy todir="${dist.dir}/doc">
+        <fileset dir="doc">
+          <include name="cql3/CQL.html" />
+          <include name="cql3/CQL.css" />
+          <include name="SASI.md" />
+        </fileset>
+      </copy>
+      <copy todir="${dist.dir}/doc/html">
+        <fileset dir="doc" />
+        <globmapper from="build/html/*" to="*"/>
+      </copy>
+    </target>
+    
     <!-- creates release tarballs -->
     <target name="artifacts" depends="_artifacts-init,gen-doc,sources-jar,javadoc-jar"
             description="Create Cassandra release artifacts">
@@ -1397,7 +1501,7 @@
           <pathelement path="${java.class.path}"/>
           <pathelement location="${stress.build.classes}"/>
           <pathelement location="${fqltool.build.classes}"/>
-          <path refid="cassandra.classpath.test" />
+          <path refid="cassandra.classpath.staged" />
           <pathelement location="${test.classes}"/>
           <pathelement location="${stress.test.classes}"/>
           <pathelement location="${fqltool.test.classes}"/>
@@ -2089,7 +2193,7 @@
   </target>
 
   <!-- ECJ 4.6.1 in standalone mode does not work with JPMS, so we skip this target for Java 11 -->
-  <target name="eclipse-warnings" depends="build, _assert_rat_output" description="Run eclipse compiler code analysis" if="java.version.8">
+  <target name="eclipse-warnings" depends="build" description="Run eclipse compiler code analysis" if="java.version.8">
         <property name="ecj.log.dir" value="${build.dir}/ecj" />
         <property name="ecj.warnings.file" value="${ecj.log.dir}/eclipse_compiler_checks.txt"/>
         <mkdir  dir="${ecj.log.dir}" />