Fix depstest by separating number_skeletons into its own group

This commit is contained in:
Shane F. Carr 2020-01-21 23:31:28 +01:00
parent ce3fa7af06
commit 4673fd3af4
4 changed files with 60 additions and 33 deletions

View file

@ -102,4 +102,16 @@ const LocalizedNumberFormatter& LocalizedNumberFormatterAsFormat::getNumberForma
return fFormatter;
}
// Definitions of public API methods (put here for dependency disentanglement)
Format* LocalizedNumberFormatter::toFormat(UErrorCode& status) const {
if (U_FAILURE(status)) {
return nullptr;
}
LocalPointer<LocalizedNumberFormatterAsFormat> retval(
new LocalizedNumberFormatterAsFormat(*this, fMacros.locale), status);
return retval.orphan();
}
#endif /* #if !UCONFIG_NO_FORMATTING */

View file

@ -11,7 +11,6 @@
#include "number_formatimpl.h"
#include "umutex.h"
#include "number_asformat.h"
#include "number_skeletons.h"
#include "number_utils.h"
#include "number_utypes.h"
#include "util.h"
@ -320,16 +319,7 @@ Derived NumberFormatterSettings<Derived>::macros(impl::MacroProps&& macros)&& {
return move;
}
template<typename Derived>
UnicodeString NumberFormatterSettings<Derived>::toSkeleton(UErrorCode& status) const {
if (U_FAILURE(status)) {
return ICU_Utility::makeBogusString();
}
if (fMacros.copyErrorTo(status)) {
return ICU_Utility::makeBogusString();
}
return skeleton::generate(fMacros, status);
}
// Note: toSkeleton defined in number_skeletons.cpp
template<typename Derived>
LocalPointer<Derived> NumberFormatterSettings<Derived>::clone() const & {
@ -358,15 +348,7 @@ LocalizedNumberFormatter NumberFormatter::withLocale(const Locale& locale) {
return with().locale(locale);
}
UnlocalizedNumberFormatter
NumberFormatter::forSkeleton(const UnicodeString& skeleton, UErrorCode& status) {
return skeleton::create(skeleton, nullptr, status);
}
UnlocalizedNumberFormatter
NumberFormatter::forSkeleton(const UnicodeString& skeleton, UParseError& perror, UErrorCode& status) {
return skeleton::create(skeleton, &perror, status);
}
// Note: forSkeleton defined in number_skeletons.cpp
template<typename T> using NFS = NumberFormatterSettings<T>;
@ -766,14 +748,7 @@ int32_t LocalizedNumberFormatter::getCallCount() const {
return umtx_loadAcquire(*callCount);
}
Format* LocalizedNumberFormatter::toFormat(UErrorCode& status) const {
if (U_FAILURE(status)) {
return nullptr;
}
LocalPointer<LocalizedNumberFormatterAsFormat> retval(
new LocalizedNumberFormatterAsFormat(*this, fMacros.locale), status);
return retval.orphan();
}
// Note: toFormat defined in number_asformat.cpp
#endif /* #if !UCONFIG_NO_FORMATTING */

View file

@ -22,6 +22,7 @@
#include "charstr.h"
#include "string_segment.h"
#include "unicode/errorcode.h"
#include "util.h"
using namespace icu;
using namespace icu::number;
@ -1684,4 +1685,35 @@ bool GeneratorHelpers::scale(const MacroProps& macros, UnicodeString& sb, UError
}
// Definitions of public API methods (put here for dependency disentanglement)
template<typename Derived>
UnicodeString NumberFormatterSettings<Derived>::toSkeleton(UErrorCode& status) const {
if (U_FAILURE(status)) {
return ICU_Utility::makeBogusString();
}
if (fMacros.copyErrorTo(status)) {
return ICU_Utility::makeBogusString();
}
return skeleton::generate(fMacros, status);
}
// Declare all classes that implement NumberFormatterSettings
// See https://stackoverflow.com/a/495056/1407170
template
class icu::number::NumberFormatterSettings<icu::number::UnlocalizedNumberFormatter>;
template
class icu::number::NumberFormatterSettings<icu::number::LocalizedNumberFormatter>;
UnlocalizedNumberFormatter
NumberFormatter::forSkeleton(const UnicodeString& skeleton, UErrorCode& status) {
return skeleton::create(skeleton, nullptr, status);
}
UnlocalizedNumberFormatter
NumberFormatter::forSkeleton(const UnicodeString& skeleton, UParseError& perror, UErrorCode& status) {
return skeleton::create(skeleton, &perror, status);
}
#endif /* #if !UCONFIG_NO_FORMATTING */

View file

@ -869,7 +869,7 @@ library: i18n
dayperiodrules
listformatter
formatting formattable_cnv regex regex_cnv translit
double_conversion number_representation number_output numberformatter numberparser
double_conversion number_representation number_output numberformatter number_skeletons numberparser
units_extra
universal_time_scale
uclean_i18n
@ -982,15 +982,15 @@ group: number_output
group: numberformatter
# ICU 60+ NumberFormatter API
number_affixutils.o number_asformat.o
number_capi.o number_compact.o number_currencysymbols.o
number_affixutils.o
number_compact.o number_currencysymbols.o
number_decimfmtprops.o
number_fluent.o number_formatimpl.o
number_grouping.o number_integerwidth.o number_longnames.o
number_mapper.o number_modifiers.o number_multiplier.o
number_notation.o number_padding.o
number_patternmodifier.o number_patternstring.o number_rounding.o
number_scientific.o number_skeletons.o
number_scientific.o
currpinf.o dcfmtsym.o numsys.o
numrange_fluent.o numrange_impl.o
deps
@ -998,6 +998,13 @@ group: numberformatter
number_representation number_output
uclean_i18n common
group: number_skeletons
# Number skeleton support; separated from numberformatter
number_skeletons.o number_capi.o number_asformat.o
deps
numberformatter
units_extra
group: numberparser
numparse_affixes.o numparse_compositions.o numparse_currency.o
numparse_decimal.o numparse_impl.o numparse_parsednumber.o
@ -1038,7 +1045,8 @@ group: formatting
# messageformat
choicfmt.o msgfmt.o plurfmt.o selfmt.o umsg.o
deps
decnumber formattable format units numberformatter numberparser formatted_value_sbimpl
decnumber formattable format units numberformatter number_skeletons numberparser
formatted_value_sbimpl
listformatter
dayperiodrules
collation collation_builder # for rbnf