Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Use cargo-edit instead of dotnet-script to inject versions. #870

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 2 additions & 9 deletions bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@ Push-Location (Join-Path $PSScriptRoot "build")
.\prerequisites.ps1
Pop-Location

cargo install cargo-edit
Push-Location (Join-Path $PSScriptRoot "./src/Simulation/qdk_sim_rs")
# We use dotnet-script to inject the version number into Cargo.toml,
# so we go on ahead here and restore any missing tools.
# Since that Cargo.toml is referenced by CMake lists in the QIR
# runtime, this injection has to be the first thing we do.
dotnet tool restore
dotnet script inject-version.csx -- `
--template Cargo.toml.template `
--out-path Cargo.toml `
--version $Env:NUGET_VERSION;
cargo set-version $Env:NUGET_VERSION;
Pop-Location

if (-not (Test-Path Env:/AGENT_OS)) { # If not CI build, i.e. local build (if AGENT_OS envvar is not defined)
Expand Down
8 changes: 4 additions & 4 deletions build/pack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ function Pack-Crate() {
$OutPath = Resolve-Path (Join-Path $PSScriptRoot $OutPath);
}
Push-Location (Join-Path $PSScriptRoot $PackageDirectory)
cargo package;
# Copy only the .crate file, since we don't need all the intermediate
# artifacts brought in by the full folder under target/package.
Copy-Item -Force (Join-Path $PSScriptRoot .. "target" "package" "*.crate") $OutPath;
cargo package --allow-dirty;
# Copy only the .crate file, since we don't need all the intermediate
# artifacts brought in by the full folder under target/package.
Copy-Item -Force (Join-Path $PSScriptRoot .. "target" "package" "*.crate") $OutPath;
Pop-Location
}

Expand Down
12 changes: 0 additions & 12 deletions src/Simulation/qdk_sim_rs/.config/dotnet-tools.json

This file was deleted.

2 changes: 0 additions & 2 deletions src/Simulation/qdk_sim_rs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ win10
target
drop

# We inject version numbers into Cargo.toml, so don't want them stored in repo.
Cargo.toml
# In the future, it would be good to enable reproducible builds by committing
# the lockfile and using --locked in calls to cargo.
Cargo.lock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[package]
name = "qdk_sim_experimental"
version = "0.1.0"
version = "0.0.1-alpha"
authors = ["Microsoft"]
edition = "2018"
license = "MIT"
Expand Down
39 changes: 0 additions & 39 deletions src/Simulation/qdk_sim_rs/inject-version.csx

This file was deleted.