Skip to content

Commit

Permalink
Rename Crates (#34)
Browse files Browse the repository at this point in the history
* Rename more crates to consistent naming scheme

* sdks dir => sdk dir

* fix workspace

* Update readme links

* Rename keyvault to key_vault

* Fix scripts

* Format json

* Push scripts

* Multi line shell
  • Loading branch information
rylev authored Oct 14, 2020
1 parent 9fc1dea commit 374e834
Show file tree
Hide file tree
Showing 530 changed files with 6,568 additions and 6,036 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:
components: rustfmt

- name: fmt
run: cargo fmt --all -- --check
run: |
cargo fmt --all -- --check
./scripts/check_json_format.sh
if: matrix.rust == 'nightly'

- name: tests
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[workspace]
members = [
"sdks/*",
"sdk/*",
]
13 changes: 13 additions & 0 deletions scripts/check_json_format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

for f in $(find sdk -name *.json)
do
jq . $f > temp
diff temp $f
error=$?
rm temp
if [ $error -ne 0 ]
then
exit 1
fi
done
11 changes: 2 additions & 9 deletions scripts/clippy_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,5 @@

set -ev

for i in azure_sdk* ; do
cd $i
cargo clean
cd ..
done

cargo clippy


cargo clean
cargo clippy
9 changes: 9 additions & 0 deletions scripts/format_json.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

echo "Formatting the following files:"
for f in $(find sdk -name *.json)
do
echo "$f"
jq . $f > temp
mv temp $f
done
35 changes: 8 additions & 27 deletions scripts/publish_all.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,10 @@
#!/usr/bin/env bash

cd sdks/azure_sdk_core
cargo publish
cd ..

sleep 20

cd azure_storage
cargo publish
cd ..

sleep 20

cd azure_auth_aad
cargo publish
cd ..

cd azure_cosmos
cargo publish
cd ..

cd azure_service_bus
cargo publish
cd ..

cd azure_keyvault
cargo publish
cd ..
for f in sdk/*
do
echo "Publishing $f"
cd $f
cargo publish
sleep 20
cd ../..
done
24 changes: 12 additions & 12 deletions sdks/core/Cargo.toml → sdk/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "azure_sdk_core"
version = "0.43.7"
description = "Rust wrappers around Microsoft Azure REST APIs - Core crate"
readme = "README.md"
authors = ["Microsoft Corp."]
license = "Apache-2.0"
repository = "https://github.com/azure/azure-sdk-for-rust"
documentation = "http://mindflavor.github.io/AzureSDKForRust/azure_sdk_for_rust/index.html"
homepage = "https://github.com/azure/azure-sdk-for-rust"
keywords = ["sdk", "azure", "rest", "iot", "cloud"]
categories = ["api-bindings"]
edition = "2018"
name = "azure_core"
version = "0.1.0"
description = "Rust wrappers around Microsoft Azure REST APIs - Core crate"
readme = "README.md"
authors = ["Microsoft Corp."]
license = "MIT"
repository = "https://github.com/azure/azure-sdk-for-rust"
homepage = "https://github.com/azure/azure-sdk-for-rust"
documentation = "https://docs.rs/azure_core"
keywords = ["sdk", "azure", "rest", "iot", "cloud"]
categories = ["api-bindings"]
edition = "2018"

[dependencies]
RustyXML = "0.3"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sdks/core/src/lib.rs → sdk/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use hyper::{Body, Client, Request};
macro_rules! response_from_headers {
($cn:ident, $($fh:ident -> $na:ident: $typ:ty),+) => {
use http::HeaderMap;
use azure_sdk_core::{
use azure_core::{
$($fh,)+
};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions sdks/cosmos/Cargo.toml → sdk/cosmos/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[package]
name = "azure_cosmos"
version = "0.1.0"
description = "Rust wrappers around Microsoft Azure REST APIs - Azure Cosmos DB"
readme = "README.md"
authors = ["Microsoft Corp."]
license = "Apache-2.0"
repository = "https://github.com/azure/azure-sdk-for-rust"
documentation = "http://mindflavor.github.io/AzureSDKForRust/azure_sdk_for_rust/index.html"
homepage = "https://github.com/azure/azure-sdk-for-rust"
name = "azure_cosmos"
version = "0.1.0"
description = "Rust wrappers around Microsoft Azure REST APIs - Azure Cosmos DB"
readme = "README.md"
authors = ["Microsoft Corp."]
license = "MIT"
repository = "https://github.com/azure/azure-sdk-for-rust"
homepage = "https://github.com/azure/azure-sdk-for-rust"
documentation = "https://docs.rs/azure_cosmos"

keywords = ["sdk", "azure", "rest", "iot", "cloud"]
categories = ["api-bindings"]

edition = "2018"

[dependencies]
azure_sdk_core = { path = "../core", version = "0.43.5" }
azure_core = { path = "../core", version = "0.1.0" }
ring = "0.16"
base64 = "0.13"
chrono = "0.4"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use azure_core::prelude::*;
use azure_cosmos::prelude::*;
use azure_sdk_core::prelude::*;
use std::borrow::Cow;
use std::error::Error;
#[macro_use]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
extern crate serde_derive;
// Using the prelude module of the Cosmos crate makes easier to use the Rust Azure SDK for Cosmos
// DB.
use azure_core::prelude::*;
use azure_cosmos::prelude::*;
use azure_cosmos::responses::GetDocumentResponse;
use azure_sdk_core::prelude::*;
use std::borrow::Cow;
use std::error::Error;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use azure_core::modify_conditions::IfMatchCondition;
use azure_core::prelude::*;
use azure_cosmos::prelude::*;
use azure_cosmos::responses::GetDocumentResponse;
use azure_sdk_core::modify_conditions::IfMatchCondition;
use azure_sdk_core::prelude::*;
use futures::stream::StreamExt;
use std::borrow::Cow;
use std::error::Error;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
extern crate serde_derive;
// Using the prelude module of the Cosmos crate makes easier to use the Rust Azure SDK for Cosmos
// DB.
use azure_core::prelude::*;
use azure_cosmos::prelude::*;
use azure_sdk_core::prelude::*;
use futures::stream::StreamExt;
use std::borrow::Cow;
use std::error::Error;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::requests;
use crate::traits::*;
use azure_sdk_core::No;
use azure_core::No;
use std::borrow::Cow;
use std::marker::PhantomData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
IntoUserDefinedFunctionClient, PartitionKeys, UserDefinedFunctionStruct, WithDocumentClient,
WithStoredProcedureClient, WithTriggerClient, WithUserDefinedFunctionClient,
};
use azure_sdk_core::No;
use azure_core::No;
use std::borrow::Cow;
use std::marker::PhantomData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use crate::{
AuthorizationToken, CosmosClient, HasHyperClient, IntoDatabaseClient, ResourceType,
WithDatabaseClient,
};
use azure_sdk_core::errors::AzureError;
use azure_sdk_core::No;
use azure_core::errors::AzureError;
use azure_core::No;
use base64;
use chrono;
use http::request::Builder as RequestBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::clients::{CollectionStruct, UserStruct};
use crate::traits::*;
use crate::{requests, CosmosClient};
use azure_sdk_core::No;
use azure_core::No;
use std::borrow::Cow;

#[derive(Debug, Clone)]
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::requests;
use crate::traits::*;
//use azure_sdk_core::No;
//use azure_core::No;
use std::borrow::Cow;
use std::marker::PhantomData;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::requests;
use crate::traits::*;
use azure_sdk_core::No;
use azure_core::No;
use std::borrow::Cow;
use std::marker::PhantomData;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::requests;
use crate::traits::*;
use azure_sdk_core::No;
use azure_core::No;
use std::borrow::Cow;
use std::marker::PhantomData;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::requests;
use crate::traits::*;
use azure_sdk_core::No;
use azure_core::No;
use std::borrow::Cow;
use std::marker::PhantomData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use crate::requests;
use crate::traits::*;
use crate::PermissionStruct;
use azure_sdk_core::No;
use azure_core::No;
use std::borrow::Cow;
use std::marker::PhantomData;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sdks/cosmos/src/document.rs → sdk/cosmos/src/document.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::DocumentAttributes;
use azure_sdk_core::errors::AzureError;
use azure_core::errors::AzureError;
use hyper::header::HeaderMap;
use serde::de::DeserializeOwned;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use azure_sdk_core::errors::AzureError;
use azure_sdk_core::prelude::IfMatchCondition;
use azure_core::errors::AzureError;
use azure_core::prelude::IfMatchCondition;
use http::HeaderMap;

#[derive(Default, Serialize, Deserialize, Debug, Clone, PartialEq)]
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::headers::*;
use crate::resource_quota::resource_quotas_from_str;
use crate::{IndexingDirective, ResourceQuota};
use azure_sdk_core::errors::AzureError;
use azure_core::errors::AzureError;
use chrono::{DateTime, Utc};
use http::HeaderMap;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use azure_sdk_core::enumerations::ParsingError;
use azure_core::enumerations::ParsingError;
use std::fmt;

#[derive(Debug, Clone, Copy, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion sdks/cosmos/src/lib.rs → sdk/cosmos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern crate serde_derive;
#[macro_use]
extern crate failure;
#[macro_use]
extern crate azure_sdk_core;
extern crate azure_core;

pub mod attachment;
mod authorization_token;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{PermissionResource, PermissionToken};
use azure_sdk_core::errors::{AzureError, UnexpectedValue};
use azure_core::errors::{AzureError, UnexpectedValue};
use serde::{Deserialize, Serialize};
use std::borrow::Cow;
use std::convert::TryInto;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 374e834

Please sign in to comment.