mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Using nix flakes for developer shell (#14888)
This commit is contained in:
parent
f5e427ad52
commit
41d691334a
1
.gitignore
vendored
1
.gitignore
vendored
@ -35,6 +35,7 @@ packages/
|
|||||||
nbproject/
|
nbproject/
|
||||||
nbactions.xml
|
nbactions.xml
|
||||||
nb-configuration.xml
|
nb-configuration.xml
|
||||||
|
.direnv/
|
||||||
|
|
||||||
.settings
|
.settings
|
||||||
|
|
||||||
|
14
README.md
14
README.md
@ -263,6 +263,20 @@ If you don't have maven installed, you may directly use the included [maven wrap
|
|||||||
./mvnw clean install
|
./mvnw clean install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Nix users
|
||||||
|
|
||||||
|
If you're a nix user, you can enter OpenAPI Generator shell, by typing:
|
||||||
|
```sh
|
||||||
|
nix develop
|
||||||
|
```
|
||||||
|
It will enter a shell with Java 8 and Maven installed.
|
||||||
|
|
||||||
|
Direnv supports automatically loading of the nix developer shell, so if you're using direnv too, type:
|
||||||
|
```sh
|
||||||
|
direnv allow
|
||||||
|
```
|
||||||
|
and have `java` and `mvn` set up with correct versions each time you enter project directory.
|
||||||
|
|
||||||
The default build contains minimal static analysis (via CheckStyle). To run your build with PMD and Spotbugs, use the `static-analysis` profile:
|
The default build contains minimal static analysis (via CheckStyle). To run your build with PMD and Spotbugs, use the `static-analysis` profile:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
42
flake.lock
generated
Normal file
42
flake.lock
generated
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1676283394,
|
||||||
|
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1678083093,
|
||||||
|
"narHash": "sha256-eTkS9GcdSAYA3cE9zCAAs9wY3+oM2zT45ydIkAcEFFQ=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "684306b246d05168e42425a3610df7e2c4d51fcd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
23
flake.nix
Normal file
23
flake.nix
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
description = "OpenAPI generator nix flake";
|
||||||
|
|
||||||
|
inputs.nixpkgs.url = "github:nixos/nixpkgs";
|
||||||
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, flake-utils, ... }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
devShells.default = pkgs.mkShell
|
||||||
|
{
|
||||||
|
buildInputs = with pkgs;[
|
||||||
|
jdk8
|
||||||
|
maven
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user