Skip to content

Commit ce81537

Browse files
committed
Move usage further up
1 parent cec82bf commit ce81537

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

README.md

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,58 @@
2121
- Do not try to replicate Gradle's behaviour, e.g. to construct a runtime classpath. Instead, use the Gradle built-ins to produce these results.
2222
- Android. But if you have experience in Android, talk to me! It might not be that hard to support android instead (by breaking/adopting Rule #5).
2323

24+
## Installation (via flakes)
25+
26+
```nix
27+
{
28+
inputs = {
29+
build-gradle-application.url = "github:raphiz/buildGradleApplication";
30+
# ...
31+
};
32+
33+
# ...
34+
outputs = {
35+
nixpkgs,
36+
build-gradle-application,
37+
...
38+
}: {
39+
# ...
40+
pkgs = import nixpkgs {
41+
inherit system;
42+
overlays = [build-gradle-application.overlays.default];
43+
};
44+
# ...
45+
};
46+
}
47+
48+
```
49+
50+
## Usage
51+
52+
The usage of `buildGradleApplication` should be straight forward once your build follows the outlined rules below. Here is a very minimal example:
53+
54+
```nix
55+
# package.nix
56+
{
57+
lib,
58+
version,
59+
buildGradleApplication,
60+
}:
61+
buildGradleApplication {
62+
pname = "hello-world";
63+
version = version;
64+
src = ./.;
65+
meta = with lib; {
66+
description = "Hello World Application";
67+
};
68+
}
69+
70+
```
71+
72+
For further examples, checkout the [example repository](https://github.com/raphiz/buildGradleApplication-examples/)
73+
74+
All available parameters of `buildGradleApplication` are documented in the [source code](https://github.com/raphiz/buildGradleApplication/blob/main/buildGradleApplication/default.nix)
75+
2476
## Rules
2577

2678
### Rule #1: Requires Checksum Verification (`verification-metadata.xml`)
@@ -203,58 +255,6 @@ If you _must_ use these features (please, don't!), use [dependency locking](http
203255

204256
For more details, see the ["Making sure resolution is reproducible" section in the Gradle Docs](https://docs.gradle.org/current/userguide/resolution_strategy_tuning.html#reproducible-resolution).
205257

206-
## Installation (via flakes)
207-
208-
```nix
209-
{
210-
inputs = {
211-
build-gradle-application.url = "github:raphiz/buildGradleApplication";
212-
# ...
213-
};
214-
215-
# ...
216-
outputs = {
217-
nixpkgs,
218-
build-gradle-application,
219-
...
220-
}: {
221-
# ...
222-
pkgs = import nixpkgs {
223-
inherit system;
224-
overlays = [build-gradle-application.overlays.default];
225-
};
226-
# ...
227-
};
228-
}
229-
230-
```
231-
232-
## Usage
233-
234-
The usage of `buildGradleApplication` should be straight forward once your build follows the outlined rules above. Here is a very minimal example:
235-
236-
```nix
237-
# package.nix
238-
{
239-
lib,
240-
version,
241-
buildGradleApplication,
242-
}:
243-
buildGradleApplication {
244-
pname = "hello-world";
245-
version = version;
246-
src = ./.;
247-
meta = with lib; {
248-
description = "Hello World Application";
249-
};
250-
}
251-
252-
```
253-
254-
For further examples, checkout the [example repository](https://github.com/raphiz/buildGradleApplication-examples/)
255-
256-
All available parameters of `buildGradleApplication` are documented in the [source code](https://github.com/raphiz/buildGradleApplication/blob/main/buildGradleApplication/default.nix)
257-
258258
### Other useful tools
259259

260260
#### `gradleFromWrapper`

0 commit comments

Comments
 (0)