From 99c4d7eaccb572207c3bf8f712eb5400057a1b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Zieli=C5=84ski?= Date: Tue, 6 Feb 2024 23:09:36 +0700 Subject: [PATCH] Fix schema generation. (#76) * Fix schema generation. * Fix project initialization. --- .github/workflows/ci-cargo-odra.yml | 8 ++++---- .gitignore | 3 ++- src/actions/init.rs | 5 +---- src/actions/schema.rs | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-cargo-odra.yml b/.github/workflows/ci-cargo-odra.yml index 6c8fee9..a37880a 100644 --- a/.github/workflows/ci-cargo-odra.yml +++ b/.github/workflows/ci-cargo-odra.yml @@ -32,7 +32,7 @@ jobs: - run: just prepare - run: just check-lint - run: just install - - run: just test-project-generation-on-future-odra - - run: just test-workspace-generation-on-future-odra -# - run: just test-project-generation-on-stable-odra -# - run: just test-workspace-generation-on-stable-odra +# - run: just test-project-generation-on-future-odra +# - run: just test-workspace-generation-on-future-odra + - run: just test-project-generation-on-stable-odra + - run: just test-workspace-generation-on-stable-odra diff --git a/.gitignore b/.gitignore index ff052b3..159ee9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /target -.idea testproject Cargo.lock +.* +!/.gitignore diff --git a/src/actions/init.rs b/src/actions/init.rs index 31d44d9..3aa6ca7 100644 --- a/src/actions/init.rs +++ b/src/actions/init.rs @@ -162,10 +162,7 @@ impl InitAction { // version let version_regex = regex::Regex::new(r"^\d+\.\d+\.\d+$").unwrap(); if version_regex.is_match(&source) { - OdraLocation::Remote( - ODRA_TEMPLATE_GH_REPO.to_string(), - Some(format!("release/{}", source)), - ) + OdraLocation::CratesIO(source) } else { // branch OdraLocation::Remote(ODRA_TEMPLATE_GH_REPO.to_string(), Some(source)) diff --git a/src/actions/schema.rs b/src/actions/schema.rs index 6bfc108..408bf24 100644 --- a/src/actions/schema.rs +++ b/src/actions/schema.rs @@ -38,7 +38,7 @@ impl SchemaAction<'_> { command::cargo_generate_schema_files( self.project.project_root(), &contract.struct_name(), - &contract.module_name(), + &contract.crate_name(self.project), ); } }