react-native-config 1.4.3 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -197,7 +197,7 @@ std::string api_key = ReactNativeConfig::API_KEY;
|
|
|
197
197
|
|
|
198
198
|
Similarly, you can access those values in other project by adding reference to the `RNCConfig` as described in the manual linking section.
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
### Availability in Build settings and Info.plist
|
|
201
201
|
|
|
202
202
|
With one extra step environment values can be exposed to "Info.plist" and Build settings in the native project.
|
|
203
203
|
|
package/android/dotenv.gradle
CHANGED
|
@@ -74,27 +74,4 @@ android {
|
|
|
74
74
|
resValue "string", k, "\"$escaped\""
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
tasks.whenTaskAdded { task ->
|
|
80
|
-
if (project.hasProperty("envConfigFiles")) {
|
|
81
|
-
project.envConfigFiles.each { envConfigName, envConfigFile ->
|
|
82
|
-
if (task.name.toLowerCase() == "generate"+envConfigName+"buildconfig") {
|
|
83
|
-
task.doFirst() {
|
|
84
|
-
android.applicationVariants.all { variant ->
|
|
85
|
-
def variantConfigString = variant.getName()
|
|
86
|
-
if (envConfigName.contains(variantConfigString.toLowerCase())) {
|
|
87
|
-
loadDotEnv(envConfigName)
|
|
88
|
-
project.env.each { k, v ->
|
|
89
|
-
def escaped = v.replaceAll("%","\\\\u0025")
|
|
90
|
-
variant.buildConfigField "String", k, "\"$v\""
|
|
91
|
-
variant.resValue "string", k, "\"$escaped\""
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
77
|
+
}
|
|
@@ -26,7 +26,7 @@ path = File.join(m_output_path, 'GeneratedDotEnv.m')
|
|
|
26
26
|
File.open(path, 'w') { |f| f.puts template }
|
|
27
27
|
|
|
28
28
|
# create header file with defines for the Info.plist preprocessor
|
|
29
|
-
info_plist_defines_objc = dotenv.map { |k, v| %Q(#define
|
|
29
|
+
info_plist_defines_objc = dotenv.map { |k, v| %Q(#define #{k} #{v}) }.join("\n")
|
|
30
30
|
|
|
31
31
|
# write it so the Info.plist preprocessor can access it
|
|
32
32
|
path = File.join(ENV["BUILD_DIR"], "GeneratedInfoPlistDotEnv.h")
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</PropertyGroup>
|
|
22
22
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
23
23
|
<PropertyGroup Label="ReactNativeWindowsProps">
|
|
24
|
-
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(
|
|
24
|
+
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(SolutionDir), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
|
|
25
25
|
</PropertyGroup>
|
|
26
26
|
<ItemGroup Label="ProjectConfigurations">
|
|
27
27
|
<ProjectConfiguration Include="Debug|ARM">
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</PropertyGroup>
|
|
22
22
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
23
23
|
<PropertyGroup Label="ReactNativeWindowsProps">
|
|
24
|
-
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(
|
|
24
|
+
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(SolutionDir), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
|
|
25
25
|
</PropertyGroup>
|
|
26
26
|
<ItemGroup Label="ProjectConfigurations">
|
|
27
27
|
<ProjectConfiguration Include="Debug|ARM">
|
|
@@ -186,4 +186,4 @@
|
|
|
186
186
|
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
|
187
187
|
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
|
188
188
|
</Target>
|
|
189
|
-
</Project>
|
|
189
|
+
</Project>
|