Giter VIP home page Giter VIP logo

nativelib-cli's Introduction

NativeLib command line interface

NativeLib is a plugin management system for Godot engine. It designed to easy operate with native libraries for iOS/Android. Also it takes care about plugin dependencies and provides hasslefree native libs updating.

If you prefer GUI instead of command line, consider using NativeLib Addon.

Update notice

After upgrade from version 0.1.x you should reload all repository info. Just make this command nativelib -U and wait a couple of minutes.

Installation (easy way)

Just do it:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/DrMoriarty/nativelib-cli/HEAD/install.sh)"

Installation (common way)

  1. Download this repository as ZIP file and unpack it.
  2. Move nativelib into some folder which is in your $PATH.
  3. Enjoy!

Requirements

You should have python3 in your system.

Getting started

Go to your project directory and setup nativelib. You should provide parameters for mobile platforms you are using.

For iOS do this command: nativelib --ios

For Android: nativelib --android

Or this if you are using both: nativelib --ios --android

Remote repository

Before using NativeLib you should fetch information from the remote repository:

nativelib --update

NativeLib won't check new packages and new versions until you again do nativelib --update.

It's time for search something useful. Do nativelib --search facebook in order to find all packages related to Facebook. You will get:

This means that full package name is facebook-plugin and it's latest version is 0.1.0.

Installing packages

Then let's go into your project folder and do nativelib -i facebook-plugin. The latest version of this package will be installed in your project. Usually packages are splitted into several parts, one part for each mobile platform and one part for universal code. NativeLib installs only such platforms which you are inited before.

Now let's see what installed in our project:

bash-3.2$ nativelib --list
Default platforms: all, ios, android

[email protected]
  platforms: all, ios, android

[email protected]
  platforms: all

You can see nativelib-export-plugin on which depends facebook-plugin and installed platforms for every package and defaults for project.

Project maintenance

NativeLib plugins usually contains binary libraries and frameworks and they can be very large. Sometimes .gitignore files are added in plugins in order to prevent uploading such libraries into your git repository.

When you clone your repository into another machine you should restore all your installed plugins. You can do this by:

nativelib --prepare

It will install all plugins with the same versions into your new cloned repo.

Sometimes you can find yourself in situation when some of your plugins was broken and compilation (for example) fails. You can reinstall plugin and all it's dependencies using force: nativelib --force --overwrite --install <package_name>. It also overwrites all plugin files so if they was modified it will return all in initial state.

Making plugins

You can use any of existing plugins as example to making your own. The plugin must have meta file usually named nativelib.json. Also it may have gd scripts and other binary files.

The first thing you should do after any modifications is meta package validation. Do this in plugin's folder:

nativelib --validate .

Packing and publishing will be blocked until you fixes all found errors. Still you could make a release with warnings.

The next step is pack your plugin. Run this command: nativelib --pack <path to plugin root> (it will always validate plugin meta in order to ensure that it is correct). This command will produce archives in your local repository at ~/.nativelib/packages/<package_name>/<package_version>/. You can check them if they contain all needed resources.

After that you can install this new plugin into your project and check it in real work.

When your plugin is ready you can make it available to all other NativeLib users. In order to upload your binary files you should have bintray account or use your GitHub repository for binary releases.

Publishing at GitHub

If you prefer to use GitHub you should:

  • install GitHub-CLI
  • login to your GitHub account (gh auth login)
  • ensure that you already pushed your plugin repository into GitHub

After that run command: nativelib --github --publish <path to plugin>. It will again validate your meta, then it will repack you archives, then it will make new release in you repository and upload binary files. At last, it will upload package meta to Godot Asset Index.

Publishing at Bintray

WARNING: It is not recommended because Bintray will be deprecated soon (https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/)

  • Register at Bintray if you didn't registered yet
  • Create new Generic repository
  • Make Api Key
  • Create file .nativelib/local.properties with this content:
bintray.subject=<organisation name>
bintray.repo=<repository name>
bintray.user=<username>
bintray.apikey=<api key>

After that you will be able to run nativelib --bintray --publish <path to plugin>. It will make new release and upload binary files. Also it will upload meta to Godot Asset Index.

Godot Asset Index

The Godot Asset Index is designed as universal storage of any godot's plugins and assets meta data. Since NativeLib 0.3.0 it used as primary packages index.

When you first time publish your plugin the file ~/.nativelib/publisher.key will be created. This is your personal publisher ID, keep it in a safe place. Only you (with your ID) can make new releases for this plugin. If you acidentaly use plugin name which is used by somebody then you can not publish your package meta. You can see all registered plugin names at https://github.com/godot-asset/index/tree/master/meta

It can be wise to use plugin name as <your-special-prefix>.<plugin-name>. But escape using _ in plugin name! Using it can break plugin packaging and installation.

nativelib-cli's People

Contributors

drmoriarty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nativelib-cli's Issues

Android module

Add field in package description for add/remove android module string.

Can't install plugins

Hi,
I got this error while trying to install the plugin:

Checking project dependencies: [email protected]
Installing [email protected]
nativelib-export_0.1.0_all.tgz  [..........] 0%Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 975, in send
    self.connect()
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/nativelib", line 1174, in <module>
    install_package(p, v)
  File "/usr/local/bin/nativelib", line 943, in install_package
    if not install_package(p, v):
  File "/usr/local/bin/nativelib", line 948, in install_package
    download_package(package_name, version, package_meta)
  File "/usr/local/bin/nativelib", line 438, in download_package
    path = download(f['url'], fname, home)
  File "/usr/local/bin/nativelib", line 413, in download
    (filepath, headers) = urlretrieve(url, os.path.join(path, filename), reporthook=_progress)
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 241, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:997)>

Android plugin

Add field in package description for auto processing android plugin.

Installation

MacOS is very similar to linux, so why we can't use the easy way to install this, I tried on ubuntu 20.04 and it's working

make "purge" command

Command to completely remove meta and packages for any plugin from the local repository.
It should work for plugin@version and for plugin. In the last case it will remove all versions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.