Skip to content

Commit

Permalink
Pilot (#30)
Browse files Browse the repository at this point in the history
* Changed default path of libiplinkc for MacOS

* resolved cloudbuild issue

* resolved cloudbuild issues

* Update cloudbuild.yaml

* Update Dockerfile

* updated docker

* Update cloudbuild.yaml

* Update cloudbuild.yaml

* Update cloudbuild.yaml

* resolved docker build timeout issue

* resolved docker build timeout issue

* Update cloudbuild.yaml

* Updated ReadME

* Update README.md

* Updated ReadMe and version

Co-authored-by: shivamkumar99 <[email protected]>
  • Loading branch information
ayush-srivastava-03 and shivamkumar99 authored May 27, 2021
1 parent 3afe5ee commit 430b78f
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 19 deletions.
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Storj-Nodejs Changelog

## [1.2.5]-29-04-2021
* Updated ReadMe.md

## [1.2.5]-28-04-2021
* Updated ReadMe.md

## [1.2.4]-19-04-2021
* Added version with libuplinkc filename
* Changed default path of libiplinkc for MacOS

## [1.2.3]-10-02-2021
* Tagged uplink-c v1.2.2
* Updated documentation
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ RUN mv go /usr/local
ENV PATH=$PATH:/usr/local/go/bin

# Installing node-gyp
RUN npm install -g node-gyp
RUN npm install -g [email protected]
RUN node-gyp -v
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ GIT_REPO=https://github.com/storj/uplink-c
UPLINKC_NAME=uplink-c
UPLINKC_VERSION=v1.2.2
#Library Name
LIBRARY_NAME_LINUX=libuplinkc.so
LIBRARY_NAME_DARWIN=libuplinkc.dylib
LIBRARY_NAME_WIN=libuplinkc.dll
LIBRARY_NAME_LINUX=libuplinkcv1.2.4.so
LIBRARY_NAME_DARWIN=libuplinkcv1.2.4.dylib
LIBRARY_NAME_WIN=libuplinkcv1.2.4.dll
LIBRARY_UPLINK=*.h
DELETE_LIBRARY_HEADER=libuplinkc.h
DELETE_LIBRARY_HEADER=libuplinkcv1.2.4.h
#Library Path
MACOS_DYLIB_DEFAULT_PAYH=/usr/local/lib
#JSFOLDER
JSFOLDER=dist
JSFOLDERLIB=libuplinkc.*
JSFOLDERLIB=libuplinkcv1.2.4.*
#Color
RED_COLOR=\033[31m
GREEN_COLOR=\033[32m
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ $ npm install -g node-gyp
```
$ npm install uplink-nodejs
```
* Set Environment variable
* MacOS
* Set DYLD_LIBRARY_PATH environment variable
* Run following command inside root directory of your project
```
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/node_modules/uplink-nodejs/
```
OR
* Copy libuplinkc*.* files from $PROJECTROOT/node_modules/uplink-nodejs/ to /usr/local/lib
* Windows
* Set Path environment variable to libuplinkc*.* which is $PROJECTROOT/node_modules/uplink-nodejs


>For NodeJS
* Please ensure Node.js with version 10 or higher is [installed](https://nodejs.org/en/download/)
Expand Down
8 changes: 4 additions & 4 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"target_name": "uplink",
"include_dirs": ["./functions"],
"sources":["./libUplink.cc", "./functions/promises_execute.cc", "./functions/promises_complete.cc", "./functions/project_operations.cc", "./functions/download_operations.cc", "./functions/upload_operations.cc", "./functions/access_operations.cc", "./functions/bucket_operations.cc", "./functions/object_operations.cc" ],
"libraries":["<(module_root_dir)/libuplinkc.so"],
"libraries":["<(module_root_dir)/libuplinkcv1.2.4.so"],
"ldflags": ["-Wl,-rpath,'$$ORIGIN'"],
"cflags_cc": ["-fexceptions","-fPIC","-Wno-unknown-pragmas"]
}
Expand All @@ -20,7 +20,7 @@
"sources":["libUplink_win.cc" , "./functions_win/promises_execute_win.cc", "./functions_win/promises_complete_win.cc", "./functions_win/project_operations_win.cc", "./functions_win/download_operations_win.cc", "./functions_win/upload_operations_win.cc", "./functions_win/access_operations_win.cc", "./functions_win/bucket_operations_win.cc", "./functions_win/object_operations_win.cc"],
"copies":[{
"destination":"<(module_root_dir)/build/Release",
"files":["<(module_root_dir)/libuplinkc.dll","<(module_root_dir)/libuplinkc.h","<(module_root_dir)/uplink_definitions.h","<(module_root_dir)/uplink_combat.h"]
"files":["<(module_root_dir)/libuplinkcversion.h","<(module_root_dir)/libuplinkcv1.2.4.dll","<(module_root_dir)/libuplinkcv1.2.4.h","<(module_root_dir)/uplink_definitions.h","<(module_root_dir)/uplink_combat.h"]
}],
"ldflags":["-Wl,-rpath","build/Release"],
},
Expand All @@ -34,10 +34,10 @@
"sources":["./libUplink.cc", "./functions/promises_execute.cc", "./functions/promises_complete.cc", "./functions/project_operations.cc", "./functions/download_operations.cc", "./functions/upload_operations.cc", "./functions/access_operations.cc", "./functions/bucket_operations.cc", "./functions/object_operations.cc"],
"copies":[{
"destination":"<(module_root_dir)/build/Release",
"files":["<(module_root_dir)/libuplinkc.dylib","<(module_root_dir)/libuplinkc.h","<(module_root_dir)/uplink_definitions.h"]
"files":["<(module_root_dir)/libuplinkcv1.2.4.dylib","<(module_root_dir)/libuplinkcv1.2.4.h","<(module_root_dir)/libuplinkcversion.h","<(module_root_dir)/uplink_definitions.h"]
}],
"link_settings": {
"libraries": ["-L/<(module_root_dir)/build/Release","libuplinkc.dylib"]
"libraries": ["-L/<(module_root_dir)/build/Release","libuplinkcv1.2.4.dylib"]
},
"ldflags":["-Wl,-rpath","build/Release"],
"cxxflags":["-fPIC"],
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:
# storing storj API key in file
- name: gcr.io/cloud-builders/gcloud
entrypoint: 'bash'
args: ["-c","gcloud secrets versions access latest --secret=StorjAPIKey >>./dist/secret.txt" ]
args: ["-c","gcloud secrets versions access latest --secret=StorjAPIKey >>./secret.txt" ]
# running npm install command
- name: 'gcr.io/${PROJECT_ID}/npm'
entrypoint: 'npm'
Expand Down
12 changes: 12 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ $ npm install -g node-gyp
$ npm install uplink-nodejs
```

* Set Environment variable
* MacOS
* Set DYLD_LIBRARY_PATH environment variable
* Run following command inside root directory of your project
```
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/node_modules/uplink-nodejs/
```
OR
* Copy libuplinkc*.* files from $PROJECTROOT/node_modules/uplink-nodejs/ to /usr/local/lib
* Windows
* Set Path environment variable to libuplinkc*.* which is $PROJECTROOT/node_modules/uplink-nodejs

>For NodeJS
* Please ensure Node.js with version 10 or higher is [installed](https://nodejs.org/en/download/)
* Check Node.js version
Expand Down
3 changes: 2 additions & 1 deletion functions/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#include <string.h>
#include <iostream>
#include "../uplink_definitions.h"
#include "../libuplinkc.h"
#include "../libuplinkcversion.h"
#include UPLINKCHEADER
using std::string;
using std::swap;

Expand Down
3 changes: 2 additions & 1 deletion functions_win/promises_execute_win.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "../libuplinkcversion.h"
#include "promises_execute_win.h"
#include <string>

HINSTANCE hGetProcIDDLL = LoadLibrary("../libuplinkc.dll");
HINSTANCE hGetProcIDDLL = LoadLibrary(UPLINKCWINDOWSDLL);

void openProjectPromiseExecute(napi_env env, void* data) {
openProjectPromiseObj* obj =
Expand Down
3 changes: 2 additions & 1 deletion libUplink_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Copyright 2020 Storj Storj

#include "libUplink_win.h"
#include "libuplinkcversion.h"
#include <string>
#include <utility>
/* A utility function to reverse a string */
Expand Down Expand Up @@ -48,7 +49,7 @@ char* itoa(int num, char* str, int base) {
}
// HINSTANCE hGetProcIDDLL;
void loaddll() {
hGetProcIDDLL = LoadLibrary("libuplinkc.dll");
hGetProcIDDLL = LoadLibrary(UPLINKCWINDOWSHOMEDLL);
}
// function creates NAPI type error object
napi_value createError(napi_env env, int64_t accessError,
Expand Down
3 changes: 3 additions & 0 deletions libuplinkcversion.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#define UPLINKCWINDOWSDLL "../libuplinkcv1.2.4.dll"
#define UPLINKCWINDOWSHOMEDLL "libuplinkcv1.2.4.dll"
#define UPLINKCHEADER "../libuplinkcv1.2.4.h"
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uplink-nodejs",
"version": "1.2.3",
"version": "1.2.6",
"description": "Storj-NodeJS bindings package",
"main": "dist/uplink.js",
"scripts": {
Expand Down
2 changes: 0 additions & 2 deletions uplink.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* eslint-disable */
import process from "process";
process.chdir(__dirname);
import {AccessResultStruct} from "./access.js";

import bindings = require("bindings");
Expand Down

0 comments on commit 430b78f

Please sign in to comment.