Skip to content

Commit

Permalink
refs fibercrypto#74 Change to path new module and name lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Maykel Arias Torres committed Dec 27, 2019
1 parent 5627b5d commit affece6
Show file tree
Hide file tree
Showing 33 changed files with 63 additions and 63 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ testrunner/
*.swo
*.orig

LibskycoinNet/skycoin
LibSkyfiberNet/skycoin

.directory

#Code generate SWIG
lib/swig/LibskycoinNet/skycoin
lib/swig/LibSkyfiberNet/skycoin
lib/swig/swig/include/libskycoin.h
2 changes: 1 addition & 1 deletion .travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
wget -c https://dist.nuget.org/win-x86-commandline/v5.1.0/nuget.exe
mono nuget.exe push ./lib/swig/LibskycoinNet/bin/Release/*.nupkg -Verbosity detailed -ApiKey $NUGET_API_KEY -Source $NUGET_SOURCE -SkipDuplicate
mono nuget.exe push ./lib/swig/LibskyfiberNet/bin/Release/*.nupkg -Verbosity detailed -ApiKey $NUGET_API_KEY -Source $NUGET_SOURCE -SkipDuplicate
(cd ./lib/skyapi/src/Skyapi/ && nuget pack ./Skyapi.nuspec)
mono nuget.exe push ./lib/skyapi/src/Skyapi/*.nupkg -Verbosity detailed -ApiKey $NUGET_API_KEY -Source $NUGET_SOURCE -SkipDuplicate
32 changes: 16 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SHELL := /bin/bash
MKFILE_PATH = $(abspath $(lastword $(MAKEFILE_LIST)))
REPO_ROOT = $(dir $(MKFILE_PATH))
GOPATH_DIR = gopath
SKYLIBC_DIR ?= $(GOPATH_DIR)/src/github.com/fibercrypto/libskycoin
SKYLIBC_DIR ?= $(GOPATH_DIR)/src/github.com/fibercrypto/libskyfiber
SKYCOIN_DIR ?= $(SKYLIBC_DIR)/vendor/github.com/skycoin/skycoin
SKYBUILD_DIR = $(SKYLIBC_DIR)/build
BUILDLIBC_DIR = $(SKYBUILD_DIR)/libskycoin
Expand Down Expand Up @@ -63,7 +63,7 @@ else
endif

# Added by Swagger
LIB_SKYCOIN_DIR = gopath/src/github.com/fibercrypto/libskycoin
LIB_SKYCOIN_DIR = gopath/src/github.com/fibercrypto/libskyfiber
SWAGGER_SPEC_DIR = $(LIB_SKYCOIN_DIR)/lib/swagger/skycoin.v0.26.0.openapi.v2.yml
CSHARP_CLIENT_DIR = lib/skyapi
CSHARP_SWIG_DIR = lib/swig
Expand Down Expand Up @@ -99,43 +99,43 @@ build-swig: ## Generate C# C module from SWIG interfaces
sed -i 's/#/%/g' $(CSHARP_SWIG_DIR)/swig/include/structs.i ;\
fi \
}
mkdir -p $(CSHARP_SWIG_DIR)/LibskycoinNet/skycoin
mkdir -p $(CSHARP_SWIG_DIR)/LibSkyfiberNet/skycoin
rm -f $(CSHARP_SWIG_DIR)/swig/include/swig.h
rm -f skycoinnet_wrap.o
rm -f skycoinnet_wrap.c
swig -csharp -oldvarnames -namespace skycoin -I$(LIBSWIG_DIR)/include -I$(INCLUDE_DIR) -outdir $(CSHARP_SWIG_DIR)/LibskycoinNet/skycoin -o skycoinnet_wrap.c $(LIBSWIG_DIR)/libdotnet.i
swig -csharp -oldvarnames -namespace skycoin -I$(LIBSWIG_DIR)/include -I$(INCLUDE_DIR) -outdir $(CSHARP_SWIG_DIR)/LibSkyfiberNet/skycoin -o skycoinnet_wrap.c $(LIBSWIG_DIR)/libdotnet.i

build-libskycoin-net: build-libc build-swig ## Build shared library including SWIG wrappers
$(CC) -c -fpic -I$(CSHARP_SWIG_DIR)/swig/include -I$(INCLUDE_DIR) -libskycoin skycoinnet_wrap.c
rm -rf build/usr/lib/$(LDNAME)
$(CC) -shared skycoinnet_wrap.o $(BUILDLIBC_DIR)/libskycoin.a -o $(LDCOPY)/$(LDNAME) $(LDFLAGS)
mkdir -p $(CSHARP_SWIG_DIR)/LibskycoinNetTest/bin
mkdir -p $(CSHARP_SWIG_DIR)/LibskycoinNetTest/bin/Release
mkdir -p $(CSHARP_SWIG_DIR)/LibskycoinNetTest/bin/Release/netcoreapp2.2
rm -rf $(CSHARP_SWIG_DIR)/LibskycoinNetTest/bin/Release/$(LDNAME)
mkdir -p $(CSHARP_SWIG_DIR)/LibSkyfiberNetTest/bin
mkdir -p $(CSHARP_SWIG_DIR)/LibSkyfiberNetTest/bin/Release
mkdir -p $(CSHARP_SWIG_DIR)/LibSkyfiberNetTest/bin/Release/netcoreapp2.2
rm -rf $(CSHARP_SWIG_DIR)/LibSkyfiberNetTest/bin/Release/$(LDNAME)

install-deps-mono: ## Install development dependencies by mono
nuget restore $(CSHARP_SWIG_DIR)/LibskycoinNet.sln
nuget restore $(CSHARP_SWIG_DIR)/LibSkyfiberNet.sln
nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory testrunner

install-deps-dotnet: ## Install development dependencies by dotnet
dotnet restore $(CSHARP_SWIG_DIR)/LibSkycoinDotNet.sln
dotnet restore $(CSHARP_SWIG_DIR)/LibSkyfiberDotNet.sln

build-sln-dotnet: install-deps-dotnet build-libc build-swig
$(LDPATHVAR)="$(LDCOPY)" dotnet msbuild /p:VisualStudioVersion=15.0 /p:Configuration=Release $(CSHARP_SWIG_DIR)/LibSkycoinDotNet.sln
$(LDPATHVAR)="$(LDCOPY)" dotnet msbuild /p:VisualStudioVersion=15.0 /p:Configuration=Release $(CSHARP_SWIG_DIR)/LibSkyfiberDotNet.sln

build-sln-mono: install-deps-mono build-libc build-swig
$(LDPATHVAR)="$(LDCOPY)" msbuild /p:VisualStudioVersion=15.0 /p:Configuration=Release $(CSHARP_SWIG_DIR)/LibskycoinNet.sln
$(LDPATHVAR)="$(LDCOPY)" msbuild /p:VisualStudioVersion=15.0 /p:Configuration=Release $(CSHARP_SWIG_DIR)/LibSkyfiberNet.sln

build-dotnet: build-libskycoin-net build-sln-dotnet ## Build LibSkycoinNet Assembly by DotNet

build-mono: build-libskycoin-net build-sln-mono ## Build LibSkycoinNet Assembly by Mono

test-libsky-mono: build-mono ## Run LibSkycoinNet test suite mono
$(LDPATHVAR)="$(LDCOPY):$(LDPATHVAR)" mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe $(CSHARP_SWIG_DIR)/LibskycoinNetTest/bin/Release/LibskycoinNetTest.dll -labels
$(LDPATHVAR)="$(LDCOPY):$(LDPATHVAR)" mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe $(CSHARP_SWIG_DIR)/LibSkyfiberNetTest/bin/Release/LibSkyfiberNetTest.dll -labels

test-libsky-dotnet: build-dotnet
$(LDPATHVAR)="$(LDCOPY):$(LDPATHVAR)" dotnet test -v n $(CSHARP_SWIG_DIR)/LibSkycoinDotNet.sln
$(LDPATHVAR)="$(LDCOPY):$(LDPATHVAR)" dotnet test -v n $(CSHARP_SWIG_DIR)/LibSkyfiberDotNet.sln

build-skyapi: ## Build SkyApi Assembly
(cd $(CSHARP_CLIENT_DIR) && /bin/sh build.sh)
Expand All @@ -145,8 +145,8 @@ test-skyapi: ## Run SkyApi test suite

lint:
gendarme --v --config rules.xml --severity critical lib/skyapi/src/Skyapi/bin/Debug/Skyapi.dll
gendarme --v --config rules.xml --severity critical lib/swig/LibskycoinNet/bin/Release/netstandard2.0/LibSkycoinDotNet.dll
gendarme --v --config rules.xml --severity critical lib/swig/LibskycoinNet/bin/Release/LibskycoinNet.dll
gendarme --v --config rules.xml --severity critical lib/swig/LibSkyfiberNet/bin/Release/netstandard2.0/LibSkyfiberDotNet.dll
gendarme --v --config rules.xml --severity critical lib/swig/LibSkyfiberNet/bin/Release/LibskyfiberNet.dll

clean: ## Clean all trash
GOPATH="$(REPO_ROOT)/$(GOPATH_DIR)" make -C $(SKYLIBC_DIR) clean-libc
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Libskycoin for .Net
# LibSkyfiber for .Net

[![Build Status](https://travis-ci.org/libskycoin-dotnet.svg?branch=develop)](https://travis-ci.org/simelo/libskycoin-dotnet)

Expand Down Expand Up @@ -61,13 +61,13 @@ For getting similar results using a graphical IDE interface consider package nam
### Install from sources

Download the repository from http://github.com/simelo/libskycoin-dotnet.git.
Execute (`nuget restore LibskycoinNet.sln`) to install the library. Although executing (`nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory testrunner`) is a better choice for making changes to the library. However, when using tox these commands are not required at all because calling tox will make any necessary installation and execute the tests.
Execute (`nuget restore LibskyfiberNet.sln`) to install the library. Although executing (`nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory testrunner`) is a better choice for making changes to the library. However, when using tox these commands are not required at all because calling tox will make any necessary installation and execute the tests.

### Usage

#### Naming

The exported function in Libskycoin .NET have the following naming format: `SKY_package_func_name` where package is replace by the package where the original Skycoin function is and func_name is the name of the function. For example, `LoadConfig` function from `cli` package is called in .Net `SKY_cli_LoadConfig`
The exported function in LibSkyfiber .NET have the following naming format: `SKY_package_func_name` where package is replace by the package where the original Skycoin function is and func_name is the name of the function. For example, `LoadConfig` function from `cli` package is called in .Net `SKY_cli_LoadConfig`

#### Parameters

Expand All @@ -84,12 +84,12 @@ Some of Skycoin types are too complex to be exported to a scripting language. So
func (c Config) FullWalletPath() string
```

Config is a struct type that is treated as a handle in Libskycoin .Net . The usage in .Net will be:
Config is a struct type that is treated as a handle in LibSkyfiber .Net . The usage in .Net will be:

```csharp

using skycoin;
namespace LibskycoinNet
namespace LibskyfiberNet
{
public class Skycoin : skycoin.skycoin
{
Expand Down Expand Up @@ -306,7 +306,7 @@ $ make test
0. If the `master` branch has commits that are not in `develop` (e.g. due to a hotfix applied to `master`), merge `master` into `develop` (and fix any build or test failures)
0. Switch to a new release branch named `release-X.Y.Z` for preparing the release.
0. Ensure that the submodule at `gopath/src/github.com/skycoin/skycoin` is in sync with respect to the corresponding tag in https://github.com/skycoin/skycoin repository.
0. Update package version (`LibskycoinNet/LibskycoinNet.csproj`)
0. Update package version (`LibskyfiberNet/LibskyfiberNet.csproj`)
0. Run `make build` to make sure that the code base is up to date
0. Update `CHANGELOG.md`: move the "unreleased" changes to the version and add the date.
0. Follow the steps in [pre-release testing](#pre-release-testing)
Expand Down Expand Up @@ -334,8 +334,8 @@ https://www.mono-project.com/download/stable/
##### Building

msbuild /p:Configuration=Release LibskycoinNet.sln
msbuild /p:Configuration=Release LibskyfiberNet.sln

Final results are placed in the LibskycoinNet/bin/Release/ folder.
Final results are placed in the LibskyfiberNet/bin/Release/ folder.


4 changes: 2 additions & 2 deletions docker/images/dev-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

- [`develop, dind, vscode, vscode-dind` (*docker/images/dev-cli/Dockerfile*)](https://github.com/simelo/libskycoin-dotnet/blob/develop/docker/images/dev-cli/Dockerfile)

# Libskycoin .NET CLI development image
# LibSkyfiber .NET CLI development image

This image has the necessary tools to build, test, edit, lint and version the Libskycoin .NET
This image has the necessary tools to build, test, edit, lint and version the LibSkyfiber .NET
source code. It comes with Vim editor installed, along with some plugins
to ease go development and version control with git.

Expand Down
2 changes: 1 addition & 1 deletion gopath/src/github.com/fibercrypto/libskyfiber
Submodule libskyfiber updated 201 files
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibSkycoinDotNet", "LibskycoinNet\LibSkycoinDotNet.csproj", "{9A1DE0D2-E9C3-415D-A551-640C279EC8E1}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibSkyfiberDotNet", "LibSkyfiberNet\LibSkyfiberDotNet.csproj", "{9A1DE0D2-E9C3-415D-A551-640C279EC8E1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibSkycoinDotNetTest", "LibskycoinNetTest\LibSkycoinDotNetTest.csproj", "{14C355AD-62A8-49D8-AD8F-3D09A44FACD0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibSkyfiberDotNetTest", "LibSkyfiberNetTest\LibSkyfiberDotNetTest.csproj", "{14C355AD-62A8-49D8-AD8F-3D09A44FACD0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C5320CD3-B673-461B-8899-19BB52862364}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>LibskycoinNet</RootNamespace>
<AssemblyName>LibskycoinNet</AssemblyName>
<RootNamespace>LibskyfiberNet</RootNamespace>
<AssemblyName>LibskyfiberNet</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<PackOnBuild>true</PackOnBuild>
<PackageId>LibskycoinNet</PackageId>
<PackageId>LibskyfiberNet</PackageId>
<Version Condition=" '$(PackageVersion)' == '' ">0.26.0</Version>
<Version Condition=" '$(PackageVersion)' != '' ">$(PackageVersion)</Version>
<PackageVersion Condition=" '$(PackageVersion)' == '' ">0.26.0</PackageVersion>
Expand All @@ -19,9 +19,9 @@
<Authors>Maykel Arias - (stdevHan), Olemis Lang (olemis), Skycoin (skycoin)</Authors>
<Description>Skycoin client library for .NET</Description>
<Product>Skycoin client library for .NET</Product>
<PackageProjectUrl>https://github.com/simelo/libskycoin-dotnet</PackageProjectUrl>
<PackageProjectUrl>https://github.com/fibercrypto/libskyfiber-dotnet</PackageProjectUrl>
<PackageIconUrl>https://avatars3.githubusercontent.com/u/29321691?s=200&amp;v=4</PackageIconUrl>
<RepositoryUrl>https://github.com/simelo/libskycoin-dotnet</RepositoryUrl>
<RepositoryUrl>hhttps://github.com/fibercrypto/libskyfiber-dotnet</RepositoryUrl>
<RepositoryType />
<PackageTags>skycoin;client-library;rest-client;restapi;rest-api;swagger;openapi;swig;dotnet;dotnet-library;csharp;csharp-library;pinvoke;pinvoke-wrapper;vbnet;dotnet-assembly</PackageTags>
<DevelopmentDependency>true</DevelopmentDependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

// [assembly: AssemblyTitle("LibskycoinNet")]
// [assembly: AssemblyTitle("LibskyfiberNet")]
// [assembly: AssemblyDescription("")]
// [assembly: AssemblyConfiguration("")]
// [assembly: AssemblyCompany("")]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\LibskycoinNet\LibSkycoinDotNet.csproj">
<ProjectReference Include="..\LibskyfiberNet\LibSkyfiberDotNet.csproj">
<Project>{9A1DE0D2-E9C3-415D-A551-640C279EC8E1}</Project>
<Name>LibSkycoinDotNet</Name>
<Name>LibSkyfiberDotNet</Name>
</ProjectReference>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DD16DD48-1CCF-478F-BD19-65A81780E7AB}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>LibskycoinNetTest</RootNamespace>
<AssemblyName>LibskycoinNetTest</AssemblyName>
<RootNamespace>LibskyfiberNetTest</RootNamespace>
<AssemblyName>LibskyfiberNetTest</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down Expand Up @@ -57,9 +57,9 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LibskycoinNet\LibskycoinNet.csproj">
<ProjectReference Include="..\LibskyfiberNet\LibskyfiberNet.csproj">
<Project>{C5320CD3-B673-461B-8899-19BB52862364}</Project>
<Name>LibskycoinNet</Name>
<Name>LibskyfiberNet</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using NUnit.Framework;
using skycoin;
namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_cipher_address : skycoin.skycoin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using NUnit.Framework;
using skycoin;
namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_cipher_bip32 : skycoin.skycoin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using NUnit.Framework;
using skycoin;
namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_cipher_bip44 : skycoin.skycoin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using NUnit.Framework;
using skycoin;
using utils;
namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_cipher_bitcoin : skycoin.skycoin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using NUnit.Framework;
using skycoin;
namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_cipher_cryto : skycoin.skycoin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using NUnit.Framework;
using skycoin;
using utils;
namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_cipher_encrypt_scrypt_chacha20poly1305 : skycoin.skycoin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using NUnit.Framework;
using skycoin;
namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_cipher_hash : skycoin.skycoin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using NUnit.Framework;
using skycoin;
namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{

[TestFixture()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using skycoin;
using utils;

namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_coin_block : skycoin.skycoin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using NUnit.Framework;
using skycoin;
using utils;
namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_coin_outputs : skycoin.skycoin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using utils;
using System.Threading;

namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_coin_transactions : skycoin.skycoin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using NUnit.Framework;
using skycoin;
using utils;
namespace LibskycoinNetTest {
namespace LibskyfiberNetTest {
[TestFixture ()]
public class check_util_droplet : skycoin.skycoin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using NUnit.Framework;
using skycoin;
using utils;
namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_util_fee : skycoin.skycoin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using NUnit.Framework;
using skycoin;
using utils;
namespace LibskycoinNetTest {
namespace LibskyfiberNetTest {
[TestFixture ()]
public class check_util_math : skycoin.skycoin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using NUnit.Framework;
using skycoin;
using utils;
namespace LibskycoinNetTest
namespace LibskyfiberNetTest
{
[TestFixture()]
public class check_util_param_distributions : skycoin.skycoin
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit affece6

Please sign in to comment.