Index: tools/gn/create_bundle_target_generator.cc |
diff --git a/tools/gn/create_bundle_target_generator.cc b/tools/gn/create_bundle_target_generator.cc |
index 608541911e1248a6173d9c16a886140d59771230..83749983e6d00383666f6f7628287ecbbb5a9926 100644 |
--- a/tools/gn/create_bundle_target_generator.cc |
+++ b/tools/gn/create_bundle_target_generator.cc |
@@ -41,6 +41,14 @@ void CreateBundleTargetGenerator::DoRun() { |
variables::kBundlePlugInsDir, |
&bundle_data.plugins_dir())) |
return; |
+ |
+ const Value* value = scope_->GetValue(variables::kProductType, true); |
+ if (value) { |
+ if (!value->VerifyTypeIs(Value::STRING, err_)) |
+ return; |
+ |
+ bundle_data.product_type().assign(value->string_value()); |
+ } |
} |
bool CreateBundleTargetGenerator::GetBundleDir( |
@@ -53,6 +61,8 @@ bool CreateBundleTargetGenerator::GetBundleDir( |
if (!value->VerifyTypeIs(Value::STRING, err_)) |
return false; |
std::string str = value->string_value(); |
+ if (!str.empty() && str[str.size() - 1] != '/') |
+ str.push_back('/'); |
if (!EnsureStringIsInOutputDir(GetBuildSettings()->build_dir(), str, |
value->origin(), err_)) |
return false; |