Unify build properties.
- Switch all system properties to project properties.
- Use the ``javaLocalNamingStyle`` instead of the
``dot.delimited.style`` for property names, so that it can be directly
referenced by ``rootProject.propertyName``.
- Recommend users to put GRPC-specific properties in project-level
``build.properties`` instead of the user-level.
diff --git a/compiler/build.gradle b/compiler/build.gradle
index f7ac54c..4efa261 100644
--- a/compiler/build.gradle
+++ b/compiler/build.gradle
@@ -35,16 +35,14 @@
}
}
-def String arch = osdetector.arch
-if (System.getProperty('arch')) {
- arch = System.getProperty('arch')
-}
+def String arch = rootProject.hasProperty('targetArch') ? rootProject.targetArch : osdetector.arch
+def boolean vcDisable = rootProject.hasProperty('vcDisable') ? rootProject.vcDisable : false
model {
toolChains {
// If you have both VC and Gcc installed, VC will be selected, unless you
- // use '-Dvc.disable'
- if (System.getProperty('vc.disable') == null) {
+ // set 'vcDisable=true'
+ if (!vcDisable) {
visualCpp(VisualCpp) {
}
}
@@ -101,12 +99,12 @@
addEnvArgs("LDFLAGS", linker.args)
} else if (toolChain in VisualCpp) {
cppCompiler.args "/EHsc", "/MD"
- if (rootProject.hasProperty('vc.protobuf.include')) {
- cppCompiler.args "/I" + rootProject.properties['vc.protobuf.include']
+ if (rootProject.hasProperty('vcProtobufInclude')) {
+ cppCompiler.args "/I${rootProject.vcProtobufInclude}"
}
linker.args "libprotobuf.lib", "libprotoc.lib"
- if (rootProject.hasProperty('vc.protobuf.libs')) {
- linker.args "/LIBPATH:" + rootProject.properties['vc.protobuf.libs']
+ if (rootProject.hasProperty('vcProtobufLibs')) {
+ linker.args "/LIBPATH:${rootProject.vcProtobufLibs}"
}
}
}