You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ad...@apache.org on 2007/11/09 07:54:32 UTC
svn commit: r593437 - in /incubator/tuscany/cpp/das: ./
VSExpress/tuscany_das/ VSExpress/tuscany_das/das_test/ antscripts/
runtime/test/ runtime/test/src/ samples/ samples/CompanySample/
samples/CompanySample/VSExpress/ samples/CompanySample/src/ tools...
Author: adrianocrestani
Date: Thu Nov 8 22:54:31 2007
New Revision: 593437
URL: http://svn.apache.org/viewvc?rev=593437&view=rev
Log:
-adding ant build system for samples and tests
-renaming TuscanyDASMSVC8DevStudioCCompiler class to TuscanyMSVC8DevStudioCCompiler and changing its package from tuscany.antCompilers to tuscany.antCompilers.das
Added:
incubator/tuscany/cpp/das/runtime/test/build.xml
incubator/tuscany/cpp/das/samples/CompanySample/build.xml
incubator/tuscany/cpp/das/samples/build.xml
incubator/tuscany/cpp/das/tools/ant_cpptasks/tuscanyAntCompilers/TuscanyMSVC8DevStudioCCompiler.java
Removed:
incubator/tuscany/cpp/das/tools/ant_cpptasks/tuscanyAntCompilers/TuscanyDASMSVC8DevStudioCCompiler.java
Modified:
incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_test/das_test.vcproj
incubator/tuscany/cpp/das/VSExpress/tuscany_das/tuscany_das.suo
incubator/tuscany/cpp/das/antscripts/TuscanyMSVC8DevStudioCCompiler.jar
incubator/tuscany/cpp/das/antscripts/system.xml
incubator/tuscany/cpp/das/build.xml
incubator/tuscany/cpp/das/runtime/test/src/main.cpp
incubator/tuscany/cpp/das/samples/CompanySample/VSExpress/CompanySample.suo
incubator/tuscany/cpp/das/samples/CompanySample/src/main.cpp
incubator/tuscany/cpp/das/tools/ant_cpptasks/build.xml
incubator/tuscany/cpp/das/tools/build.xml
Modified: incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_test/das_test.vcproj
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_test/das_test.vcproj?rev=593437&r1=593436&r2=593437&view=diff
==============================================================================
--- incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_test/das_test.vcproj (original)
+++ incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_test/das_test.vcproj Thu Nov 8 22:54:31 2007
@@ -204,27 +204,47 @@
Name="Resource Files"
>
<File
- RelativePath="..\..\..\runtime\test\resource\testCompositeRelationship.xml"
+ RelativePath="..\..\..\runtime\test\rsc\testCompositeRelationship.xml"
>
</File>
<File
- RelativePath="..\..\..\runtime\test\resource\testIncompleteCompositeRelationship1.xml"
+ RelativePath="..\..\..\runtime\test\rsc\testCreateOperation.xml"
>
</File>
<File
- RelativePath="..\..\..\runtime\test\resource\testIncompleteCompositeRelationship2.xml"
+ RelativePath="..\..\..\runtime\test\rsc\testDeleteOperation.xml"
>
</File>
<File
- RelativePath="..\..\..\runtime\test\resource\testKeyPairColumnTypeNotEqual.xml"
+ RelativePath="..\..\..\runtime\test\rsc\testIncompleteCompositeRelationship1.xml"
>
</File>
<File
- RelativePath="..\..\..\runtime\test\resource\testManyRelationship1.xml"
+ RelativePath="..\..\..\runtime\test\rsc\testIncompleteCompositeRelationship2.xml"
>
</File>
<File
- RelativePath="..\..\..\runtime\test\resource\testManyRelationship2.xml"
+ RelativePath="..\..\..\runtime\test\rsc\testKeyPairColumnTypeNotEqual.xml"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\runtime\test\rsc\testManyRelationship1.xml"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\runtime\test\rsc\testManyRelationship2.xml"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\runtime\test\rsc\testModifyOperation.xml"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\runtime\test\rsc\testOCC1.xml"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\runtime\test\rsc\testOCC2.xml"
>
</File>
</Filter>
Modified: incubator/tuscany/cpp/das/VSExpress/tuscany_das/tuscany_das.suo
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/VSExpress/tuscany_das/tuscany_das.suo?rev=593437&r1=593436&r2=593437&view=diff
==============================================================================
Binary files - no diff available.
Modified: incubator/tuscany/cpp/das/antscripts/TuscanyMSVC8DevStudioCCompiler.jar
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/antscripts/TuscanyMSVC8DevStudioCCompiler.jar?rev=593437&r1=593436&r2=593437&view=diff
==============================================================================
Binary files - no diff available.
Modified: incubator/tuscany/cpp/das/antscripts/system.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/antscripts/system.xml?rev=593437&r1=593436&r2=593437&view=diff
==============================================================================
--- incubator/tuscany/cpp/das/antscripts/system.xml (original)
+++ incubator/tuscany/cpp/das/antscripts/system.xml Thu Nov 8 22:54:31 2007
@@ -306,6 +306,7 @@
</if>
+
<!--
Configure the object.ext
Take the override value from platform.properties if set
@@ -419,11 +420,13 @@
so we made our own until the bugs are resolved. The actual implementation
of TuscanyDASMSVC8DevStudioCCompiler is in TuscanyDAS/tools/ant_cpptasks
-->
- <compiler id="msvc8-Compiler"
+
+ <compiler id="msvc8-Compiler"
extends="Tuscany-BaseCompiler"
- classname="tuscany.antCompilers.TuscanyDASMSVC8DevStudioCCompiler">
+ classname="tuscany.antCompilers.das.TuscanyMSVC8DevStudioCCompiler">
<defineset define="WIN32,_CRT_SECURE_NO_DEPRECATE,_CRT_NON_CONFORMING_SWPRINTFS"/>
</compiler>
+
<!-- g++ compiler for most Unix platforms -->
<compiler id="g++-Compiler" extends="Tuscany-BaseCompiler" name="g++"/>
Modified: incubator/tuscany/cpp/das/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/build.xml?rev=593437&r1=593436&r2=593437&view=diff
==============================================================================
--- incubator/tuscany/cpp/das/build.xml (original)
+++ incubator/tuscany/cpp/das/build.xml Thu Nov 8 22:54:31 2007
@@ -19,6 +19,9 @@
-->
<project name="TuscanyDASNative" default="all" basedir=".">
+<property name="test.dir" location="runtime/test"/>
+<property name="samples.dir" location="samples"/>
+<property name="tools.dir" location="tools"/>
<!--
This is the root level ant build.xml file for TuscanyDAS Native
@@ -36,13 +39,12 @@
-->
<target name="all" description="build and install all TuscanyDASNative source code and documentation">
- <antcall target="build"/>
- <antcall target="install"/>
+ <antcall target="build"/>
+ <antcall target="install"/>
</target>
<target name="build" description="Build all TuscanyDASNative source code and documentation">
- <antcall target="build.das"/>
- <!--antcall target="generate.docs"/-->
+ <antcall target="build.das"/>
</target>
<target name="install" description="Install TuscanyDASNative libraries and headers">
@@ -52,13 +54,21 @@
<target name="clean" description="Clean all TuscanyDASNative compiled source code">
<antcall target="clean.das"/>
- <!--antcall target="clean.docs"/-->
+ <antcall target="clean.tests"/>
</target>
-
- <target name="test" description="Run DAS tests, not implemented yet">
- <!-- TODO finish this -->
+
+ <target name="tools" description="Build and Install all TuscanyDASNative tools">
+ <antcall target="build.tools"/>
</target>
+<target name="samples" description="Build and Install all TuscanyDASNative samples">
+ <antcall target="build.samples"/>
+</target>
+
+<target name="tests" description="Build and run all TuscanyDASNative tests">
+ <ant target="all" antfile="${test.dir}/build.xml" inheritAll="false"/>
+</target>
+
<!--
Internal targets
@@ -66,6 +76,10 @@
Using antfile and inheritAll="false" to maintain the subdir build.xml basedir settings
-->
+ <target name="build.tools">
+ <ant target="all" antfile="${tools.dir}/build.xml" inheritAll="false"/>
+ </target>
+
<target name="build.das">
<ant target="build" antfile="${runtime.das.dir}/build.xml" inheritAll="false"/>
</target>
@@ -78,16 +92,25 @@
<ant target="install" antfile="${runtime.das.dir}/build.xml" inheritAll="false"/>
</target>
- <target name="install.docs">
- <!--ant target="install.docs" antfile="${runtime.das.dir}/build.xml" inheritAll="false"/-->
- </target>
-
+
<target name="clean.das">
<ant target="clean" antfile="${runtime.das.dir}/build.xml" inheritAll="false"/>
</target>
- <target name="clean.docs">
- <!--ant target="clean.docs" antfile="${runtime.das.dir}/build.xml" inheritAll="false"/-->
+ <target name="clean.tools">
+ <ant target="clean" antfile="${tools.dir}/build.xml" inheritAll="false"/>
+ </target>
+
+<target name="clean.tests">
+ <ant target="clean" antfile="${test.dir}/build.xml" inheritAll="false"/>
+ </target>
+
+ <target name="build.samples">
+ <ant target="all" antfile="${samples.dir}/build.xml" inheritAll="false"/>
+ </target>
+
+ <target name="clean.samples">
+ <ant target="clean" antfile="${samples.dir}/build.xml" inheritAll="false"/>
</target>
</project>
Added: incubator/tuscany/cpp/das/runtime/test/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/test/build.xml?rev=593437&view=auto
==============================================================================
--- incubator/tuscany/cpp/das/runtime/test/build.xml (added)
+++ incubator/tuscany/cpp/das/runtime/test/build.xml Thu Nov 8 22:54:31 2007
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project name="TuscanyDASNative_tests" default="all" basedir="../..">
+
+ <import file="${basedir}/antscripts/system.xml"/>
+ <import file="${basedir}/antscripts/compile-targets.xml"/>
+
+ <!--
+ Notice that the basedir for this project is set to the TuscanyDAS root dir
+ This makes path setting in system.xml much simpler, but we'll just have to
+ set a property here to this directory.
+ -->
+
+ <target name="init">
+ <tstamp/>
+ <property name="this.dir" location="${basedir}/runtime/test"/>
+ <property name="test.dir" location="${this.dir}/build"/>
+ <property name="test.src.dir" location="${this.dir}/src/"/>
+ <property name="test.build.dir" location="${test.dir}/build"/>
+ <property name="test.install.dir"
+ location="${tuscanyDAS.install.dir}/test"/>
+ </target>
+
+ <!--
+ Public targets
+ -->
+ <target name="all"
+ description="build and install the TuscanyDASNative test">
+ <antcall target="build"/>
+ <antcall target="install"/>
+ </target>
+
+ <target name="build"
+ description="build the TuscanyDASNative test">
+ <antcall target="build.test"/>
+ </target>
+
+ <target name="install"
+ description="Install the TuscanyDASNative test">
+ <antcall target="install.test"/>
+ </target>
+
+ <target name="clean"
+ description="Clean the TuscanyDASNative test">
+ <antcall target="clean.test"/>
+ <delete dir="${test.install.dir}" quiet="true"/>
+ </target>
+
+ <!--
+ Internal targets
+ They can still be called, they're just not described, so wont show up in "ant -p"
+ -->
+
+ <!-- build -->
+
+ <target name="build.test" depends="init,check.sdo">
+ <mkdir dir="${test.build.dir}"/>
+
+ <copy todir="${test.build.dir}">
+ <fileset dir="${test.dir}" includes="*.cpp"/>
+ </copy>
+ <!-- build the library -->
+ <cpp-build
+ srcdir="${test.src.dir}"
+ infiles="*.cpp"
+ outdir="${test.build.dir}/.libs"
+ outtype="executable"
+ outfile="das_test">
+ <custom-build-elements>
+ <includepath path="${tuscanyDAS.install.dir}/include"/>
+ <includepath path="${tuscany.sdo.home.dir}/include"/>
+
+ <libset dir="${tuscanyDAS.install.dir}/lib" libs="tuscany_das"/>
+ <libset dir="${tuscany.sdo.home.dir}/lib" libs="tuscany_sdo"/>
+ <libset libs="odbc32"/>
+
+ </custom-build-elements>
+ </cpp-build>
+ </target>
+
+
+ <!-- install -->
+
+ <target name="install.test" depends="init">
+ <cpp-install-files
+ files="*.exe*"
+ srcdir="${test.dir}/build/.libs/"
+ destdir="${test.install.dir}"/>
+
+ <cpp-install-files
+ files="*.xml"
+ srcdir="${this.dir}/rsc"
+ destdir="${test.install.dir}/rsc"/>
+
+
+
+
+ </target>
+
+ <!-- clean -->
+
+ <target name="clean.test" depends="init">
+ <delete dir="${test.build.dir}" quiet="true"/>
+ <delete dir="${test.install.dir}/test" quiet="true"/>
+ </target>
+
+</project>
Modified: incubator/tuscany/cpp/das/runtime/test/src/main.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/test/src/main.cpp?rev=593437&r1=593436&r2=593437&view=diff
==============================================================================
--- incubator/tuscany/cpp/das/runtime/test/src/main.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/test/src/main.cpp Thu Nov 8 22:54:31 2007
@@ -33,9 +33,8 @@
#include <commonj/sdo/DataObject.h>
#include <commonj/sdo/SDORuntimeException.h>
#include <commonj/sdo/DataFactory.h>
-#include <libxml/xmlreader.h>
-#define TEST_RESOURCE_PATH "../../../../runtime/test/rsc/"
+#define TEST_RESOURCE_PATH "rsc/"
using namespace std;
using namespace apache::das;
Modified: incubator/tuscany/cpp/das/samples/CompanySample/VSExpress/CompanySample.suo
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/samples/CompanySample/VSExpress/CompanySample.suo?rev=593437&r1=593436&r2=593437&view=diff
==============================================================================
Binary files - no diff available.
Added: incubator/tuscany/cpp/das/samples/CompanySample/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/samples/CompanySample/build.xml?rev=593437&view=auto
==============================================================================
--- incubator/tuscany/cpp/das/samples/CompanySample/build.xml (added)
+++ incubator/tuscany/cpp/das/samples/CompanySample/build.xml Thu Nov 8 22:54:31 2007
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project name="TuscanyDASNative_Sample_CompanySample" default="all" basedir="../..">
+
+ <import file="${basedir}/antscripts/system.xml"/>
+ <import file="${basedir}/antscripts/compile-targets.xml"/>
+
+ <!--
+ Notice that the basedir for this project is set to the TuscanyDAS root dir
+ This makes path setting in system.xml much simpler, but we'll just have to
+ set a property here to this directory.
+ -->
+
+ <target name="init">
+ <tstamp/>
+ <property name="this.dir" location="${basedir}/samples/CompanySample"/>
+ <property name="sample.CompanySample.dir" location="${this.dir}/build"/>
+ <property name="sample.CompanySample.src.dir" location="${this.dir}/src/"/>
+ <property name="sample.CompanySample.build.dir" location="${sample.CompanySample.dir}/build"/>
+ <property name="CompanySample.install.dir"
+ location="${tuscanyDAS.install.dir}/samples/CompanySample"/>
+ </target>
+
+ <!--
+ Public targets
+ -->
+ <target name="all"
+ description="build and install the TuscanyDASNative CompanySample sample">
+ <antcall target="build"/>
+ <antcall target="install"/>
+ </target>
+
+ <target name="build"
+ description="build the TuscanyDASNative CompanySample sample">
+ <antcall target="build.sample.CompanySample"/>
+ </target>
+
+ <target name="install"
+ description="Install the TuscanyDASNative CompanySample sample">
+ <antcall target="install.sample.CompanySample"/>
+ </target>
+
+ <target name="clean"
+ description="Clean the TuscanyDASNative CompanySample sample">
+ <antcall target="clean.sample.CompanySample"/>
+ <delete dir="${CompanySample.install.dir}" quiet="true"/>
+ </target>
+
+ <!--
+ Internal targets
+ They can still be called, they're just not described, so wont show up in "ant -p"
+ -->
+
+ <!-- build -->
+
+ <target name="build.sample.CompanySample" depends="init,check.sdo">
+ <mkdir dir="${sample.CompanySample.build.dir}"/>
+
+ <copy todir="${sample.CompanySample.build.dir}">
+ <fileset dir="${sample.CompanySample.dir}" includes="*.h"/>
+ <fileset dir="${sample.CompanySample.dir}" includes="*.cpp"/>
+ </copy>
+ <!-- build the library -->
+ <cpp-build
+ srcdir="${sample.CompanySample.src.dir}"
+ infiles="*.cpp"
+ outdir="${sample.CompanySample.build.dir}/.libs"
+ outtype="executable"
+ outfile="CompanySample">
+ <custom-build-elements>
+ <includepath path="${tuscanyDAS.install.dir}/include"/>
+ <includepath path="${tuscany.sdo.home.dir}/include"/>
+
+ <libset dir="${tuscanyDAS.install.dir}/lib" libs="tuscany_das"/>
+ <libset dir="${tuscany.sdo.home.dir}/lib" libs="tuscany_sdo"/>
+ <libset libs="odbc32"/>
+
+ </custom-build-elements>
+ </cpp-build>
+ </target>
+
+
+ <!-- install -->
+
+ <target name="install.sample.CompanySample" depends="init">
+<echo message="sample.dir = ${sample.CompanySample.dir}"/>
+ <cpp-install-files
+ files="*.exe*"
+ srcdir="${sample.CompanySample.dir}/build/.libs/"
+ destdir="${CompanySample.install.dir}"/>
+
+
+
+
+ </target>
+
+ <!-- clean -->
+
+ <target name="clean.sample.CompanySample" depends="init">
+ <delete dir="${sample.CompanySample.build.dir}" quiet="true"/>
+ <delete dir="${CompanySample.install.dir}/sample.CompanySample" quiet="true"/>
+ </target>
+
+
+</project>
Modified: incubator/tuscany/cpp/das/samples/CompanySample/src/main.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/samples/CompanySample/src/main.cpp?rev=593437&r1=593436&r2=593437&view=diff
==============================================================================
--- incubator/tuscany/cpp/das/samples/CompanySample/src/main.cpp (original)
+++ incubator/tuscany/cpp/das/samples/CompanySample/src/main.cpp Thu Nov 8 22:54:31 2007
@@ -135,19 +135,19 @@
DataObjectPtr root = command->executeQuery();
// Get all companies
- DataObjectList& companyList = root->getList("company");
+ DataObjectList& companyList = root->getList("COMPANY");
// Print each company id and name
for (int i = 0 ; i < companyList.size() ; i++) {
// Get the company id
- long id = companyList[i]->getInt("id");
+ long id = companyList[i]->getInt("ID");
// Get the name string length and allocate enough space for it
- unsigned int stringLength = companyList[i]->getLength("name");
+ unsigned int stringLength = companyList[i]->getLength("NAME");
wchar_t* buffer = new wchar_t[stringLength];
// Get the company name
- companyList[i]->getString("name", buffer, stringLength);
+ companyList[i]->getString("NAME", buffer, stringLength);
wstring name = wstring(buffer, stringLength);
// Print the company data
@@ -161,17 +161,17 @@
}
// Get a company named "apache"
- DataObjectPtr company = root->getDataObject("company[name='apache']");
+ DataObjectPtr company = root->getDataObject("COMPANY[NAME='apache']");
// Remove the first department of this company and get it
- commonj::sdo::DataObjectPtr department = company->getList("department").remove(0);;
+ commonj::sdo::DataObjectPtr department = company->getList("DEPARTMENT").remove(0);;
// Change the company name to "amd"
wstring companyName = L"amd";
- company->setString("name", companyName.c_str(), companyName.size());
+ company->setString("NAME", companyName.c_str(), companyName.size());
// The department is added to the company named "ibm"
- root->getDataObject("company[name='ibm']")->getList("department").append(department);
+ root->getDataObject("COMPANY[NAME='ibm']")->getList("DEPARTMENT").append(department);
// The graph changes are persited on the database
das->applyChanges(root);
Added: incubator/tuscany/cpp/das/samples/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/samples/build.xml?rev=593437&view=auto
==============================================================================
--- incubator/tuscany/cpp/das/samples/build.xml (added)
+++ incubator/tuscany/cpp/das/samples/build.xml Thu Nov 8 22:54:31 2007
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<project name="TuscanyDASNative_samples" default="all" basedir="..">
+
+ <!--
+ This is the root level ant build.xml file for TuscanyDAS Native samples
+ Nothing is actually performed here, it just delegates to subdirectory
+ build.xml files.
+ -->
+
+ <import file="${basedir}/antscripts/system.xml"/>
+ <import file="${basedir}/antscripts/compile-targets.xml"/>
+
+
+ <!--
+ Notice that the basedir for this project is set to the TuscanyDAS root dir
+ This makes path setting in system.xml much simpler, but we'll just have to
+ set a property here to this directory.
+ -->
+ <property name="this.dir" location="${basedir}/samples"/>
+
+ <property name="CompanySample.dir" location="${this.dir}/CompanySample"/>
+
+ <!--
+ Public targets
+ -->
+
+ <target name="all" description="Build and install all TuscanyDASNative samples">
+ <antcall target="CompanySample"/>
+ </target>
+
+ <!--
+ Using antfile and inheritAll="false" to maintain the subdir build.xml basedir settings
+ -->
+
+ <target name="CompanySample" description="Build and install the CompanySample sample">
+ <ant target="all" antfile="${CompanySample.dir}/build.xml" inheritAll="false"/>
+ </target>
+
+ <!-- clean -->
+
+ <target name="clean" description="Clean all TuscanyDASNative samples">
+ <ant target="clean" antfile="${CompanySample.dir}/build.xml" inheritAll="false"/>
+ </target>
+
+</project>
Modified: incubator/tuscany/cpp/das/tools/ant_cpptasks/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/tools/ant_cpptasks/build.xml?rev=593437&r1=593436&r2=593437&view=diff
==============================================================================
--- incubator/tuscany/cpp/das/tools/ant_cpptasks/build.xml (original)
+++ incubator/tuscany/cpp/das/tools/ant_cpptasks/build.xml Thu Nov 8 22:54:31 2007
@@ -19,7 +19,7 @@
-->
-<project name="org.apache.tuscany.sca.cpp.antCompilers" default="all" basedir="../..">
+<project name="org.apache.tuscany.das.cpp.antCompilers" default="all" basedir="../..">
<import file="${basedir}/antscripts/system.xml"/>
<import file="${basedir}/antscripts/compile-targets.xml"/>
@@ -30,7 +30,7 @@
<property name="build.dir" location="${this.dir}/build" />
<property name="java.src.dir" location="${this.dir}/tuscanyAntCompilers" />
<property name="install.dir" location="${basedir}/antscripts" />
- <property name="class.name" value="TuscanyDASMSVC8DevStudioCCompiler" />
+ <property name="class.name" value="TuscanyMSVC8DevStudioCCompiler" />
</target>
<target name="all" depends="init,build,install"/>
@@ -53,9 +53,9 @@
<target name="make.jar" depends="init,build">
<jar jarfile="${build.dir}/${class.name}.jar"
basedir="${build.dir}"
- includes="tuscany/antCompilers/${class.name}.class">
+ includes="tuscany/antCompilers/das/${class.name}.class">
<manifest>
- <attribute name="Main-Class" value="tuscany.antCompilers.${class.name}" />
+ <attribute name="Main-Class" value="tuscany.antCompilers.das.${class.name}" />
</manifest>
</jar>
</target>
Added: incubator/tuscany/cpp/das/tools/ant_cpptasks/tuscanyAntCompilers/TuscanyMSVC8DevStudioCCompiler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/tools/ant_cpptasks/tuscanyAntCompilers/TuscanyMSVC8DevStudioCCompiler.java?rev=593437&view=auto
==============================================================================
--- incubator/tuscany/cpp/das/tools/ant_cpptasks/tuscanyAntCompilers/TuscanyMSVC8DevStudioCCompiler.java (added)
+++ incubator/tuscany/cpp/das/tools/ant_cpptasks/tuscanyAntCompilers/TuscanyMSVC8DevStudioCCompiler.java Thu Nov 8 22:54:31 2007
@@ -0,0 +1,227 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package tuscany.antCompilers.das;
+
+import java.io.File;
+import java.util.Vector;
+
+import net.sf.antcontrib.cpptasks.CUtil;
+import net.sf.antcontrib.cpptasks.OptimizationEnum;
+
+import net.sf.antcontrib.cpptasks.compiler.CommandLineCompilerConfiguration;
+import net.sf.antcontrib.cpptasks.compiler.CompilerConfiguration;
+import net.sf.antcontrib.cpptasks.compiler.Linker;
+import net.sf.antcontrib.cpptasks.compiler.LinkType;
+import net.sf.antcontrib.cpptasks.compiler.PrecompilingCommandLineCCompiler;
+import net.sf.antcontrib.cpptasks.compiler.Processor;
+
+import net.sf.antcontrib.cpptasks.devstudio.DevStudioProcessor;
+import net.sf.antcontrib.cpptasks.devstudio.DevStudioLinker;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.Environment;
+
+
+/**
+ * An abstract base class for compilers that are basically command line
+ * compatible with Microsoft(r) C/C++ Optimizing Compiler
+ *
+ * This class was taken from cpptasks. Its a combination of the following 2 classes:
+ * net.sf.antcontrib.cpptasks.devstudio.DevStudioCompatibleCCompiler
+ * net.sf.antcontrib.cpptasks.devstudio.DevStudioCCompiler
+ *
+ * To compile MSVC8.0 in debug mode, the cpptasks msvc compiler doesnt distinguish
+ * between msvc 7.1 and 8.0 and seems to actually be 7.1 centric. This implementation
+ * For the Apache Tuscany project tries to address those issues.
+ */
+
+public final class TuscanyMSVC8DevStudioCCompiler
+ extends PrecompilingCommandLineCCompiler
+{
+ private static String[] mflags_ =
+ new String[] {"/ML", "/MLd", null, null, "/MT", "/MTd", "/MD", "/MDd"};
+ // first four are single-threaded
+ // (runtime=static,debug=false), (..,debug=true),
+ // (runtime=dynamic,debug=true), (..,debug=false), (not supported)
+ // next four are multi-threaded, same sequence
+
+ // Indeces into the mflags_ array
+ private static int MINDEX_DEBUG = 1;
+ private static int MINDEX_STATIC_RUNTIME = 2;
+ private static int MINDEX_MULTI_THREADED = 4;
+
+ private static final TuscanyMSVC8DevStudioCCompiler instance_ =
+ new TuscanyMSVC8DevStudioCCompiler( "cl", false, null);
+
+ public static TuscanyMSVC8DevStudioCCompiler getInstance()
+ {
+ return instance_;
+ }
+
+ private TuscanyMSVC8DevStudioCCompiler(
+ String command,
+ boolean newEnvironment,
+ Environment env)
+ {
+ super(command,
+ "/bogus",
+ new String[]{".c", ".cc", ".cpp", ".cxx", ".c++"},
+ new String[]{".h", ".hpp", ".inl"},
+ ".obj",
+ false,
+ null,
+ newEnvironment,
+ env);
+ }
+
+ public Processor changeEnvironment(boolean newEnvironment, Environment env)
+ {
+ if (newEnvironment || env != null) {
+ return new TuscanyMSVC8DevStudioCCompiler(getCommand(), newEnvironment, env);
+ }
+ return this;
+ }
+
+ public Linker getLinker(LinkType type)
+ {
+ return DevStudioLinker.getInstance().getLinker(type);
+ }
+
+ public int getMaximumCommandLength()
+ {
+ return 32767;
+ }
+
+ protected void addImpliedArgs(
+ final Vector args,
+ final boolean debug,
+ final boolean multithreaded,
+ final boolean exceptions,
+ final LinkType linkType,
+ final Boolean rtti,
+ final OptimizationEnum optimization)
+ {
+ args.addElement("/c");
+ args.addElement("/nologo");
+ if (exceptions) {
+ // changed to eliminate warning on VC 2005, should support VC 6 and later
+ // use /GX to support VC5 - 2005 (with warning)
+ args.addElement("/EHsc");
+ }
+ int mindex = 0;
+ if (multithreaded) {
+ mindex += MINDEX_MULTI_THREADED;
+ }
+ boolean staticRuntime = linkType.isStaticRuntime();
+ if (!staticRuntime) {
+ mindex += MINDEX_STATIC_RUNTIME;
+ }
+
+ if (debug) {
+ mindex += MINDEX_DEBUG;
+ args.addElement("/Zi"); // Generates complete debugging information
+ args.addElement("/Od"); // Disables optimization
+
+ // Native DAS gets corrupted stack memory when /RTC1 argument is added
+ //args.addElement("/RTC1"); // Enables run-time error checking as opposed to depracated /GZ
+
+ args.addElement("/Gd"); // Uses the __cdecl calling convention (x86 only)
+ args.addElement("/D_DEBUG"); // Debug mode
+ } else {
+ args.addElement("/DNDEBUG");
+ if (optimization != null) {
+ if (optimization.isSize()) {
+ args.addElement("/O1");
+ }
+
+ if (optimization.isSpeed()) {
+ args.addElement("/O2");
+ }
+ }
+ }
+
+ String mflag = mflags_[mindex];
+ if (mflag == null) {
+ throw new BuildException(
+ "multithread='false' and runtime='dynamic' not supported");
+ }
+ args.addElement(mflag);
+ if (rtti != null && rtti.booleanValue()) {
+ args.addElement("/GR");
+ }
+ }
+
+ protected void addWarningSwitch(Vector args, int level)
+ {
+ DevStudioProcessor.addWarningSwitch(args, level);
+ }
+
+ protected CompilerConfiguration createPrecompileGeneratingConfig(
+ CommandLineCompilerConfiguration baseConfig,
+ File prototype,
+ String lastInclude)
+ {
+ String[] additionalArgs = new String[]{
+ "/Fp" + CUtil.getBasename(prototype) + ".pch", "/Yc"};
+ return new
+ CommandLineCompilerConfiguration(
+ baseConfig,
+ additionalArgs,
+ null,
+ true);
+ }
+
+ protected CompilerConfiguration createPrecompileUsingConfig(
+ CommandLineCompilerConfiguration baseConfig,
+ File prototype,
+ String lastInclude,
+ String[] exceptFiles)
+ {
+ String[] additionalArgs = new String[]{
+ "/Fp" + CUtil.getBasename(prototype) + ".pch",
+ "/Yu" + lastInclude};
+ return new
+ CommandLineCompilerConfiguration(
+ baseConfig,
+ additionalArgs,
+ exceptFiles,
+ false);
+ }
+
+ protected void getDefineSwitch(StringBuffer buffer, String define, String value)
+ {
+ DevStudioProcessor.getDefineSwitch(buffer, define, value);
+ }
+
+ protected File[] getEnvironmentIncludePath()
+ {
+ return CUtil.getPathFromEnvironment("INCLUDE", ";");
+ }
+
+ protected String getIncludeDirSwitch(String includeDir)
+ {
+ return DevStudioProcessor.getIncludeDirSwitch(includeDir);
+ }
+
+ protected void getUndefineSwitch(StringBuffer buffer, String define)
+ {
+ DevStudioProcessor.getUndefineSwitch(buffer, define);
+ }
+}
Modified: incubator/tuscany/cpp/das/tools/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/tools/build.xml?rev=593437&r1=593436&r2=593437&view=diff
==============================================================================
--- incubator/tuscany/cpp/das/tools/build.xml (original)
+++ incubator/tuscany/cpp/das/tools/build.xml Thu Nov 8 22:54:31 2007
@@ -1,105 +1,95 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-
-<project name="TuscanyScaNative_tools" default="all" basedir="..">
-
- <!--
- This is the root level ant build.xml file for TuscanySCA Native tools
- Nothing is actually performed here, it just delegates to subdirectory
- build.xml files.
- -->
-
- <import file="${basedir}/antscripts/system.xml"/>
- <import file="${basedir}/antscripts/compile-targets.xml"/>
-
- <!--
- Notice that the basedir for this project is set to the TuscanySCA root dir
- This makes path setting in system.xml much simpler, but we'll just have to
- set a property here to this directory.
- -->
-
- <property name="this.dir" location="${basedir}/tools"/>
- <property name="TuscanyDriver.dir" location="${this.dir}/TuscanyDriver"/>
- <property name="ant_cpptasks.dir" location="${this.dir}/ant_cpptasks"/>
-
- <!--
- Public targets
- -->
-
- <target name="all" description="Build and install all TuscanyScaNative tools">
- <antcall target="build"/>
- <antcall target="install"/>
- </target>
-
- <!--
- Notice the ant_cpptasks tool is not included in the "all" target.
- This is because its not something that should be built that often.
- The resulting jar is included in TUSCANY_SCA_SRC_ROOT/antscripts svn
- -->
-
- <target name="build" description="Build all TuscanyScaNative tools">
- <antcall target="build.TuscanyDriver"/>
- </target>
-
- <target name="install" description="Install TuscanyScaNative tools">
- <antcall target="install.TuscanyDriver"/>
- </target>
-
- <target name="clean" description="Clean all TuscanyScaNative tools">
- <antcall target="clean.TuscanyDriver"/>
- </target>
-
- <!--
- Internal targets
- They can still be called, they're just not described, so wont show up in "ant -p"
- Using antfile and inheritAll="false" to maintain the subdir build.xml basedir settings
- -->
-
- <!-- build -->
-
- <target name="build.ant_cpptasks">
- <ant target="build" antfile="${ant_cpptasks.dir}/build.xml" inheritAll="false"/>
- </target>
-
- <target name="build.TuscanyDriver">
- <ant target="build" antfile="${TuscanyDriver.dir}/build.xml" inheritAll="false"/>
- </target>
-
- <!-- install -->
-
- <target name="install.ant_cpptasks">
- <ant target="install" antfile="${ant_cpptasks.dir}/build.xml" inheritAll="false"/>
- </target>
-
- <target name="install.TuscanyDriver">
- <ant target="install" antfile="${TuscanyDriver.dir}/build.xml" inheritAll="false"/>
- </target>
-
- <!-- clean -->
-
- <target name="clean.ant_cpptasks">
- <ant target="clean" antfile="${ant_cpptasks.dir}/build.xml" inheritAll="false"/>
- </target>
-
- <target name="clean.TuscanyDriver">
- <ant target="clean" antfile="${TuscanyDriver.dir}/build.xml" inheritAll="false"/>
- </target>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<project name="TuscanyDASNative_tools" default="all" basedir="..">
+
+ <!--
+ This is the root level ant build.xml file for TuscanyDAS Native tools
+ Nothing is actually performed here, it just delegates to subdirectory
+ build.xml files.
+ -->
+
+ <import file="${basedir}/antscripts/system.xml"/>
+ <import file="${basedir}/antscripts/compile-targets.xml"/>
+
+ <!--
+ Notice that the basedir for this project is set to the TuscanyDAS root dir
+ This makes path setting in system.xml much simpler, but we'll just have to
+ set a property here to this directory.
+ -->
+
+ <property name="this.dir" location="${basedir}/tools"/>
+ <property name="ant_cpptasks.dir" location="${this.dir}/ant_cpptasks"/>
+
+ <!--
+ Public targets
+ -->
+
+ <target name="all" description="Build and install all TuscanyDASNative tools">
+ <antcall target="build"/>
+ <antcall target="install"/>
+ </target>
+
+ <!--
+ Notice the ant_cpptasks tool is not included in the "all" target.
+ This is because its not something that should be built that often.
+ The resulting jar is included in TUSCANY_DAS_SRC_ROOT/antscripts svn
+ -->
+
+ <target name="build" description="Build all TuscanyDASNative tools">
+ <antcall target="build.ant_cpptasks"/>
+ </target>
+
+<target name="install" description="Install TuscanyDASNative tools">
+ <antcall target="install.ant_cpptasks"/>
+ </target>
+
+
+ <target name="clean" description="Clean all TuscanyDASNative tools">
+ <antcall target="clean.ant_cpptasks"/>
+ </target>
+
+ <!--
+ Internal targets
+ They can still be called, they're just not described, so wont show up in "ant -p"
+ Using antfile and inheritAll="false" to maintain the subdir build.xml basedir settings
+ -->
+
+ <!-- build -->
+
+ <target name="build.ant_cpptasks">
+ <ant target="build" antfile="${ant_cpptasks.dir}/build.xml" inheritAll="false"/>
+ </target>
+
+ <!-- install -->
+
+ <target name="install.ant_cpptasks">
+ <ant target="install" antfile="${ant_cpptasks.dir}/build.xml" inheritAll="false"/>
+ </target>
+
+
+ <!-- clean -->
+
+ <target name="clean.ant_cpptasks">
+ <ant target="clean" antfile="${ant_cpptasks.dir}/build.xml" inheritAll="false"/>
+ </target>
+
+
+</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org