Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtbuilds committed Nov 29, 2023
1 parent 70d6930 commit a06fa3b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 24 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ defaults:
run:
shell: bash


jobs:
run-test:
permissions:
Expand All @@ -27,5 +26,12 @@ jobs:
toolchain: stable
- uses: Swatinem/rust-cache@v1
- run: cargo install just
# - run: just test
- name: Install checkexec
shell: bash
run: |
which checkexec && exit 0
curl -LO https://github.com/kurtbuilds/checkexec/releases/download/v0.2.0/checkexec-v0.2.0-x86_64-unknown-linux-musl.tar.gz
tar xvzf checkexec-v0.2.0-x86_64-unknown-linux-musl.tar.gz checkexec
chmod +x checkexec
sudo mv checkexec /usr/local/bin
- run: cargo test
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
target/

.env*
!.env.example

.env*
!.env.example

.env*
!.env.example

.env*
!.env.example
gen
Expand Down
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ generate:
cargo run -- gen --name $SERVICE --output-dir $REPO_DIR --generator $SOURCEGEN --github $REPO --version $VERSION $LIBRARY $SPEC

test *ARGS:
checkexec commercial -- just dummy_commercial
cd core && cargo test -- "$@"
cd libninja && cargo test -- "$@"
alias t := test
Expand Down Expand Up @@ -129,4 +130,10 @@ push:
bash ocg/script/push.sh

commercial:
rm -rf commercial
git clone https://github.com/kurtbuilds/libninja-commercial commercial

# Create a dummy commercial repo that lets the workspace work
# without the commericial code
dummy_commercial:
cargo new --lib commercial --name libninja_commercial
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ cargo install --git https://github.com/kurtbuilds/libninja
Use the command line help to see required arguments & options when generating libraries.

The open source version builds client libraries for Rust. Libninja also supports other languages with a commercial license. Reach out at the email in author Github profile.


# Development

If you run into errors about a missing `commericial` package, run the command `just dummy_commericial` to create a dummy
package.

3 changes: 3 additions & 0 deletions libninja/src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ pub fn calculate_extras(spec: &HirSpec) -> Extras {

pub fn copy_from_target_templates(opts: &OutputOptions) -> Result<()> {
let template_path = opts.dest_path.join("template");
if !template_path.exists() {
return Ok(());
}
for path in ignore::Walk::new(&template_path) {
let path: ignore::DirEntry = path?;
let rel_path = path.path().strip_prefix(&template_path)?;
Expand Down

0 comments on commit a06fa3b

Please sign in to comment.