cli_ure/Executable_climaker.mk | 2 cli_ure/source/climaker/climaker_app.cxx | 154 ++++++++++---------------- solenv/gbuild/CliUnoApi.mk | 4 solenv/gbuild/UnoApiTarget.mk | 4 testtools/CustomTarget_bridgetest_climaker.mk | 4 unoil/CustomTarget_climaker.mk | 4 6 files changed, 72 insertions(+), 100 deletions(-)
New commits: commit 16a1bf5d079ef2b98f97ca40c3f6f4785056477e Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon Apr 29 13:37:15 2013 +0200 climaker no longer needs *.rdb.oldformat input files Change-Id: I55447aba5abcc8205543c7ca64763b5c99854837 diff --git a/solenv/gbuild/CliUnoApi.mk b/solenv/gbuild/CliUnoApi.mk index 008fa73..63ba9e7 100644 --- a/solenv/gbuild/CliUnoApi.mk +++ b/solenv/gbuild/CliUnoApi.mk @@ -68,13 +68,13 @@ $(call gb_CliUnoApiTarget_get_target,$(1)) : CLI_UNOAPI_VERSION := $(2) endef define gb_CliUnoApiTarget_wrap_api -$(call gb_CliUnoApiTarget_get_target,$(1)) : CLI_UNOAPI_API := $(call gb_UnoApiTarget_get_target,$(2)).oldformat +$(call gb_CliUnoApiTarget_get_target,$(1)) : CLI_UNOAPI_API := $(call gb_UnoApiTarget_get_target,$(2)) $(call gb_CliUnoApiTarget_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(2)) endef define gb_CliUnoApiTarget__use_api -$(call gb_CliUnoApiTarget_get_target,$(1)) : CLI_UNOAPI_DEPS += $(2).oldformat +$(call gb_CliUnoApiTarget_get_target,$(1)) : CLI_UNOAPI_DEPS += $(2) $(call gb_CliUnoApiTarget_get_target,$(1)) : $(2) endef diff --git a/testtools/CustomTarget_bridgetest_climaker.mk b/testtools/CustomTarget_bridgetest_climaker.mk index 370a73c..9610a23 100644 --- a/testtools/CustomTarget_bridgetest_climaker.mk +++ b/testtools/CustomTarget_bridgetest_climaker.mk @@ -42,7 +42,7 @@ $(testtools_CLIDIR)/cli_types_bridgetest.dll : \ $(call gb_Helper_execute,climaker) \ $(if $(filter -s,$(MAKEFLAGS)),,--verbose) \ --out $@ -r $(OUTDIR)/bin/cli_uretypes.dll \ - -X $(call gb_UnoApiTarget_get_target,udkapi).oldformat \ - $(call gb_UnoApiTarget_get_target,bridgetest).oldformat > /dev/null) + -X $(call gb_UnoApiTarget_get_target,udkapi) \ + $(call gb_UnoApiTarget_get_target,bridgetest) > /dev/null) # vim:set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/unoil/CustomTarget_climaker.mk b/unoil/CustomTarget_climaker.mk index 9d1ef46..016f662 100644 --- a/unoil/CustomTarget_climaker.mk +++ b/unoil/CustomTarget_climaker.mk @@ -32,10 +32,10 @@ $(unoil_CLIDIR)/cli_oootypes.dll : $(SRCDIR)/unoil/climaker/version.txt \ --assembly-version $(CLI_OOOTYPES_NEW_VERSION) \ --assembly-company "LibreOffice" \ --assembly-description "This assembly contains metadata for the LibreOffice API." \ - -X $(call gb_UnoApiTarget_get_target,udkapi).oldformat \ + -X $(call gb_UnoApiTarget_get_target,udkapi) \ -r $(OUTDIR)/bin/cli_uretypes.dll \ --keyfile $(OUTDIR)/bin/cliuno.snk \ - $(call gb_UnoApiTarget_get_target,offapi).oldformat) > /dev/null) + $(call gb_UnoApiTarget_get_target,offapi)) > /dev/null) $(unoil_CLIDIR)/cli_oootypes.config : \ $(SRCDIR)/unoil/climaker/cli_oootypes_config \ commit 1728ab7125dd622d324779cfc62762b1f79fc769 Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon Apr 29 13:35:53 2013 +0200 Remove dependency of climaker on registry format See the comment in climaker_app.cxx main about room for improvement. Change-Id: I11cc2f62c9d42269d5c96253198ee4e730496e75 diff --git a/cli_ure/Executable_climaker.mk b/cli_ure/Executable_climaker.mk index c8dd3da..2c30b5c 100644 --- a/cli_ure/Executable_climaker.mk +++ b/cli_ure/Executable_climaker.mk @@ -29,6 +29,8 @@ $(eval $(call gb_Executable_use_libraries,climaker,\ cppu \ cppuhelper \ sal \ + salhelper \ + unoidl \ $(gb_UWINAPI) \ )) diff --git a/cli_ure/source/climaker/climaker_app.cxx b/cli_ure/source/climaker/climaker_app.cxx index e74cc23..12c63a7 100755 --- a/cli_ure/source/climaker/climaker_app.cxx +++ b/cli_ure/source/climaker/climaker_app.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" + +#include <cstdlib> +#include <iostream> #include <stdio.h> #include <vector> #include <memory> @@ -30,13 +34,12 @@ #include "rtl/ustrbuf.hxx" #include "cppuhelper/shlib.hxx" #include "cppuhelper/bootstrap.hxx" -#include "com/sun/star/lang/XInitialization.hpp" -#include "com/sun/star/lang/XSingleComponentFactory.hpp" #include "com/sun/star/lang/XComponent.hpp" #include "com/sun/star/container/XHierarchicalNameAccess.hpp" #include "com/sun/star/container/XSet.hpp" #include "com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp" -#include "com/sun/star/registry/XSimpleRegistry.hpp" +#include "com/sun/star/uno/XComponentContext.hpp" +#include "unoidl/unoidl.hxx" using namespace ::std; using namespace ::System::Reflection; @@ -239,65 +242,15 @@ static OUString path_make_absolute_file_url( OUString const & path ) { throw RuntimeException( "cannot make absolute: " + file_url, - Reference< XInterface >() ); + css::uno::Reference< XInterface >() ); } } else { throw RuntimeException( "cannot get file url from system path: " + path, - Reference< XInterface >() ); - } -} - -//============================================================================== -Reference< registry::XSimpleRegistry > open_registries( - vector< OUString > const & registries, - Reference< XComponentContext > xContext ) -{ - if (registries.empty()) - { - throw RuntimeException( - "no registries given!", - Reference< XInterface >() ); - } - - Reference< registry::XSimpleRegistry > xSimReg; - for ( size_t nPos = registries.size(); nPos--; ) - { - Reference< registry::XSimpleRegistry > xReg( - xContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.registry.SimpleRegistry", xContext ), - UNO_QUERY_THROW ); - xReg->open( registries[ nPos ], sal_True, sal_False ); - if (! xReg->isValid()) - { - throw RuntimeException( - "invalid registry: " + registries[ nPos ], - Reference< XInterface >() ); - } - - if (xSimReg.is()) // nest? - { - Reference< registry::XSimpleRegistry > xNested( - xContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.registry.NestedRegistry", xContext ), - UNO_QUERY_THROW ); - Reference< lang::XInitialization > xInit( - xNested, UNO_QUERY_THROW ); - Sequence< Any > args( 2 ); - args[ 0 ] <<= xReg; - args[ 1 ] <<= xSimReg; - xInit->initialize( args ); - xSimReg = xNested; - } - else - { - xSimReg = xReg; - } + css::uno::Reference< XInterface >() ); } - - return xSimReg; } } @@ -315,7 +268,7 @@ SAL_IMPLEMENT_MAIN() } int ret = 0; - Reference< XComponentContext > xContext; + css::uno::Reference< XComponentContext > xContext; try { @@ -433,7 +386,7 @@ SAL_IMPLEMENT_MAIN() "to print all options.") ); throw RuntimeException( buf.makeStringAndClear(), - Reference< XInterface >() ); + css::uno::Reference< XInterface >() ); } else { @@ -453,45 +406,37 @@ SAL_IMPLEMENT_MAIN() // bootstrap uno xContext = ::cppu::defaultBootstrap_InitialComponentContext(); - Reference< container::XHierarchicalNameAccess > xTDmgr( + css::uno::Reference< container::XHierarchicalNameAccess > xTDmgr( xContext->getValueByName( "/singletons/com.sun.star.reflection." "theTypeDescriptionManager" ), UNO_QUERY_THROW ); - // get rdb tdprovider factory - Reference< lang::XSingleComponentFactory > xTDprov_factory( - ::cppu::loadSharedLibComponentFactory( - "bootstrap.uno" SAL_DLLEXTENSION, OUString(), - "com.sun.star.comp.stoc.RegistryTypeDescriptionProvider", - Reference< lang::XMultiServiceFactory >( - xContext->getServiceManager(), UNO_QUERY ), - Reference< registry::XRegistryKey >(), "bootstrap_" ), - UNO_QUERY ); - if (! xTDprov_factory.is()) - { - throw RuntimeException( - "cannot get registry typedescription provider: " - "bootstrap.uno" SAL_DLLEXTENSION "!", - Reference< XInterface >() ); - } - - // create registry td provider for mandatory registry files - Any arg( makeAny( open_registries( mandatory_registries, xContext ) ) ); - Reference< XInterface > xTD_provider( - xTDprov_factory->createInstanceWithArgumentsAndContext( - Sequence< Any >( &arg, 1 ), xContext ) ); - // insert provider to tdmgr - Reference< container::XSet > xSet( xTDmgr, UNO_QUERY_THROW ); + // The registries are consumed twice, once to insert them into the + // TypeDescriptionManager so that TypeEmitter can work on + // css.star.reflection.XTypeDescription representation, and once + // directly as unoidl::Provider instances to keep track which types are + // coming from the mandatory registries for the "no explicit types + // given" case (which iterates over the full TypeDescriptionManager + // now); a welcome clean-up would be to make TypeEmitter work on + // unoidl::Entity directly like the other codemakers: + css::uno::Reference< container::XSet > xSet( xTDmgr, UNO_QUERY_THROW ); + rtl::Reference< unoidl::Manager > unoidlMgr(new unoidl::Manager); + std::vector< rtl::Reference< unoidl::Provider > > unoidlMandatoryProvs; for (vector< OUString >::iterator i(extra_registries.begin()); i != extra_registries.end(); ++i) { xSet->insert(makeAny(*i)); + unoidlMgr->addProvider(unoidl::loadProvider(unoidlMgr, *i)); } for (vector< OUString >::iterator i(mandatory_registries.begin()); i != mandatory_registries.end(); ++i) { xSet->insert(makeAny(*i)); + rtl::Reference< unoidl::Provider > prov( + unoidl::loadProvider(unoidlMgr, *i)); + unoidlMgr->addProvider(prov); + unoidlMandatoryProvs.push_back(prov); } if (0 == output.getLength()) // no output file specified @@ -519,7 +464,7 @@ SAL_IMPLEMENT_MAIN() throw RuntimeException( "cannot get system path from file url " + output.copy( 0, slash ), - Reference< XInterface >() ); + css::uno::Reference< XInterface >() ); } OUString filename( output.copy( slash +1 ) ); sal_Int32 dot = filename.lastIndexOf( '.' ); @@ -660,27 +605,40 @@ SAL_IMPLEMENT_MAIN() // and emit types to it if (explicit_types.empty()) { - Reference< reflection::XTypeDescriptionEnumeration > xTD_enum( - Reference< reflection::XTypeDescriptionEnumerationAccess >( - xTD_provider, UNO_QUERY_THROW ) + css::uno::Reference< reflection::XTypeDescriptionEnumeration > xTD_enum( + css::uno::Reference< reflection::XTypeDescriptionEnumerationAccess >( + xTDmgr, UNO_QUERY_THROW ) ->createTypeDescriptionEnumeration( OUString() /* all IDL modules */, Sequence< TypeClass >() /* all classes of types */, reflection::TypeDescriptionSearchDepth_INFINITE ) ); while (xTD_enum->hasMoreElements()) { - type_emitter->get_type( xTD_enum->nextTypeDescription() ); + css::uno::Reference< reflection::XTypeDescription > td( + xTD_enum->nextTypeDescription()); + OUString name(td->getName()); + bool emit = false; + for (std::vector< rtl::Reference< unoidl::Provider > >::iterator + i(unoidlMandatoryProvs.begin()); + i != unoidlMandatoryProvs.end(); ++i) + { + if ((*i)->findEntity(name).is()) { + emit = true; + break; + } + } + if (emit) { + type_emitter->get_type(td); + } } } else { - Reference< container::XHierarchicalNameAccess > xHNA( - xTD_provider, UNO_QUERY_THROW ); for ( size_t nPos = explicit_types.size(); nPos--; ) { type_emitter->get_type( - Reference< reflection::XTypeDescription >( - xHNA->getByHierarchicalName( explicit_types[ nPos ] ), + css::uno::Reference< reflection::XTypeDescription >( + xTDmgr->getByHierarchicalName( explicit_types[ nPos ] ), UNO_QUERY_THROW ) ); } } @@ -710,6 +668,18 @@ SAL_IMPLEMENT_MAIN() } current_appdomain->TypeResolve -= type_resolver; } + catch (unoidl::NoSuchFileException & e) + { + std::cerr << "ERROR: No such file <" << e.getUri() << ">\n"; + return EXIT_FAILURE; + } + catch (unoidl::FileFormatException & e) + { + std::cerr + << "ERROR: Bad format of <" << e.getUri() << ">, \"" + << e.getDetail() << "\"\n"; + return EXIT_FAILURE; + } catch (Exception & exc) { OString msg( @@ -732,7 +702,7 @@ SAL_IMPLEMENT_MAIN() try { - Reference< lang::XComponent > xComp( xContext, UNO_QUERY ); + css::uno::Reference< lang::XComponent > xComp( xContext, UNO_QUERY ); if (xComp.is()) xComp->dispose(); } commit 411524d10ac88698605c67f69b3015125f9a84aa Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon Apr 29 13:35:30 2013 +0200 Typos Change-Id: I2ff65979a9da7da12ad6ac97dc090898913a2e8c diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index 915fd68..cc2a463 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -128,10 +128,10 @@ $(call gb_UnoApiTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),UNO,4) -$(call gb_Helper_abbreviate_dirs,\ rm -f $(call gb_UnoApiTarget_get_target,$*) \ - $(call gb_UnoApiTarget_get_target,$*).oldformat + $(call gb_UnoApiTarget_get_target,$*).oldformat \ -rm -rf $(call gb_UnoApiTarget_get_dep_target,$*) \ $(basename $(call gb_UnoApiPartTarget_get_dep_target,$*)) \ - $(call gb_UnoApiPartTarget_get_target,$*) + $(call gb_UnoApiPartTarget_get_target,$*)) # cat the deps of all IDLs in one file, then we need only open that one file define gb_UnoApiTarget__command_dep _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits