Skip to content

Commit

Permalink
feat: add gradle.properties option
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiSviridov committed Jan 12, 2024
1 parent c728ca3 commit 2a9baaf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ Users have the opportunity to adjust the prompt that is sent to the LLM platform
## TestSpark for JetBrains employees
JetBrains employees have the ability to send queries to OpenAI models through the [Grazie platform](https://try.ai.intellij.net/chat).

### Using Grazie platform

#### Pass Space username and token as properties

1) To include test generation using Grazie in the build process, you need to pass Space username and token as properties:\
`gradle buildPlugin -Dspace.username=<USERNAME> -Dspace.pass=<TOKEN>`.

Expand All @@ -363,6 +367,17 @@ JetBrains employees have the ability to send queries to OpenAI models through th

3) `<TOKEN>` is generated by [Space](https://jetbrains.team/), which has access to `Automatically generating unit tests` maven packages.

#### Using `gradle.properties`

Store Space username and token in `~/.gradle/gradle.properties`
```
...
spaceUsername=<USERNAME>
spacePassword=<TOKEN>
...
```


### LLM Settings with Grazie
LLM Settings with Grazie platform option:

Expand Down
6 changes: 4 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ fun properties(key: String) = project.findProperty(key).toString()

val thunderdomeVersion = "1.0.5"

val spaceUsername = System.getProperty("space.username")?.toString().orEmpty()
val spacePassword = System.getProperty("space.pass")?.toString().orEmpty()
val spaceUsername =
System.getProperty("space.username")?.toString() ?: project.properties["spaceUsername"]?.toString() ?: ""
val spacePassword =
System.getProperty("space.pass")?.toString() ?: project.properties["spacePassword"]?.toString() ?: ""

plugins {
// Java support
Expand Down

0 comments on commit 2a9baaf

Please sign in to comment.