Skip to content

Commit fca20e8

Browse files
committed
update API docs
1 parent 1bdac31 commit fca20e8

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

packages/website/docs/configuration-tool.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ The operation supports inserting arbitrary Gradle code, or when using `replace`,
222222
The Gradle commands supports two modes: `insert` or `replace`:
223223

224224
- `insert` inserts new Gradle snippets at the desired location in the file
225+
- This operation takes either a raw string of Groovy-based Gradle, or an object. When using the object, make sure to set the `insertType` (see next line) to ensure the correct code is generated.
226+
- This operation takes an `insertType` of either `'method'` (default) or `'variable'` which will create either a method call (`methodName methodArg`) or an assignment (`variable = value`).
225227
- `replace` replaces existing entries in the Gradle file at the desired location
226228

227229
Currently, the tool supports updating primitive types (numbers, strings, booleans), and arrays of primitives. Strings need additional quoting if necessary, in order to support non-quoted variable strings. See the example below for string quoting examples.
@@ -246,6 +248,13 @@ platforms:
246248
- url: 'https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1'
247249
- name: 'Duo-SDK-Feed'
248250
251+
- file: variables.gradle
252+
target:
253+
ext:
254+
insertType: 'variable'
255+
insert:
256+
- firebaseMessagingVersion: '20.0.6'
257+
249258
- file: app/build.gradle
250259
target:
251260
insert: |

packages/website/docs/project-api.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,15 @@ buildGradleFile.insertProperties(
300300
},
301301
[{ classpath: 'com.my.custom.gradle.plugin' }]
302302
);
303+
304+
// To insert a variable assignment (thing = value) set the insertType to 'variable':
305+
buildGradleFile.insertProperties(
306+
{
307+
buildscript: {},
308+
},
309+
insertType: 'variable',
310+
[{ firebaseMessagingVersion: '20.0.6' }]
311+
);
303312
```
304313

305314
To add raw Gradle strings:

0 commit comments

Comments
 (0)