Skip to content

Commit

Permalink
Use git resolution for dojo_plugin (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev authored Jun 7, 2023
1 parent 6adb8f4 commit 992ec44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion crates/dojo-core/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ cairo-version = "1.1.0"
description = "The Dojo Core library for autonomous worlds."

[dependencies]
dojo_plugin = { path = "../dojo-lang" }
dojo_plugin = { git = "/~https://github.com/dojoengine/dojo" }
starknet = ">=1.0.0"
12 changes: 3 additions & 9 deletions crates/dojo-lang/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ use cairo_lang_syntax::attribute::structured::{
use cairo_lang_syntax::node::db::SyntaxGroup;
use cairo_lang_syntax::node::helpers::QueryAttrs;
use cairo_lang_syntax::node::{ast, Terminal};
use camino::Utf8Path;
use dojo_world::manifest::{Dependency, Member};
use scarb::compiler::plugin::builtin::BuiltinSemanticCairoPlugin;
use scarb::core::{PackageId, PackageName, SourceId};
use semver::Version;
use smol_str::SmolStr;
use url::Url;

use crate::component::handle_component_struct;
use crate::system::System;
Expand Down Expand Up @@ -174,19 +174,13 @@ pub struct CairoPluginRepository(scarb::compiler::plugin::CairoPluginRepository)
impl CairoPluginRepository {
pub fn new() -> Self {
let mut repo = scarb::compiler::plugin::CairoPluginRepository::empty();
let url = Url::parse("/~https://github.com/dojoengine/dojo").unwrap();
let dojo_package_id = PackageId::new(
PackageName::new("dojo_plugin"),
Version::parse("0.1.0").unwrap(),
SourceId::for_std(),
SourceId::for_git(&url, &scarb::core::GitReference::DefaultBranch).unwrap(),
);
repo.add(Box::new(BuiltinSemanticCairoPlugin::<DojoPlugin>::new(dojo_package_id))).unwrap();
let dojo_local_package_id = PackageId::new(
PackageName::new("dojo_plugin"),
Version::parse("0.1.0").unwrap(),
SourceId::for_path(Utf8Path::new(env!("CARGO_MANIFEST_DIR"))).unwrap(),
);
repo.add(Box::new(BuiltinSemanticCairoPlugin::<DojoPlugin>::new(dojo_local_package_id)))
.unwrap();
let starknet_package_id = PackageId::new(
PackageName::STARKNET,
Version::parse("1.1.0").unwrap(),
Expand Down

0 comments on commit 992ec44

Please sign in to comment.