Progsbase Tool

Download

Requirements

Installation

The progsbase tool is a Java program. You need Java 7 or higher.

Run the program using:

java -jar progsbase-1.0.1-SNAPSHOT.jar

On Unix-like environments, you can make a script progsbase.sh:

#!/bin/sh

java -jar <path>/progsbase-1.0.1-SNAPSHOT.jar "[email protected]"

And make a symlink:

sudo ln -s <path>/progsbase.sh /usr/bin/progsbase

On Windows, you can make a script progsbase.bat:

@java -jar <path>\progsbase-1.0.1-SNAPSHOT.jar %*

Then add progsbase.bat to your PATH.

Now you can invoke progsbase using only the command progsbase

    ProgsBase.com Command Line Tool - Remote - v1.0.1-SNAPSHOT
    Copyright (c) 2018-20 Inductive AS

    Use one of the following commands (some of the commands have further sub-options):
     - login ....... logs in
     - logout ...... logs out
     - check ....... checks the current authentication status
     - analyze ..... analyzes the program in the current folder
     - convert ..... converts the program in the current folder to another programming language
     - importdeps .. imports dependencies of the program in the current folder
     - upload ...... uploads the program in the current folder to the repository
    also:
     - -h, --help .. shows this message

Specification File – info.json

The progsbase tool uses a specification file named info.json. This file is used for the commands analyze, convert, importdeps and upload. When running the progsbase tool, the tool will try to open the info.json file in the current working directory, the directory in which you are running the command.

The following is the info.json file for the Matrices library version 0.2.13:

{
"name": "Matrices",
"version": "0.2.13",
"organization namespace": "no.inductive.libraries",
"scientific namespace": "mathematics.matrices.basic",
"imports": [
["","no.inductive.libraries","PolynomialSolver","0.1.9"],
["","no.inductive.idea10.programs","references","0.1.5"],
["math","no.inductive.idea10.programs","math","0.1.18"],
["c","no.inductive.libraries","ComplexNumbers","0.1.13"],
["p", "no.inductive.libraries", "Polynomials", "0.1.21"],
["", "no.inductive.idea10.programs", "strings", "0.9.9"],
["n", "no.inductive.idea10.programs", "numbers", "0.1.19"]
],
"development imports": [
["","no.inductive.idea10.programs","testing","0.1.8"]
],
"reprefix": [],
"ownerCustomerId": "Inductive AS",
"isPrivate": false
}

Name

The name field contains the name of the project. The progsbase project code is stored in a folder with this name. The name must be unique within its namespaces.

If the specification file is only used to import dependencies to a project, then name, version and namespaces are not used by the progsbase tool. These are only used when uploading to the global repository, so that it is possible for others to reuse the library or program.

Version

The version field contains the version of the project. The format of the version is <major>.<minor>.<patch><-SNAPSHOT>. Each of major, minor and patch are positive integer values. The presence of “-SNAPSHOT” means a version is work-in-progress and can change. The absence of “-SNAPSHOT” means that a version is final.

In general, major indicates major changes to the design of a program. This includes function names, protocols and inputs and outputs. minor indicates that the general design is the same, but some things have been adjusted, such as a few inputs and outputs. patch indicates bug fixes.

A major version of 0 generaly indicates that the program is not production ready.

Namespace

There are two namespaces: Organization Namespace and Scientific Namespace. The organization namespaces specifies the organization that owns the program: Country code, company name, department or subcategory, etc. In the example above, the contry code is “no” for Norway, the company name is “inductive”, and the department or subcategory is “libraries”.

Notice that the online repository of progsbase code uses the organization namespace, the project name and the version to build the URL for the library:

https://repo.progsbase.com/repoviewer/no.inductive.libraries/Matrices/0.2.13/

There is also the scientific namespace. This indicates the scientific category of the library, starting with the major branch and then narrowing down. In the above example, the most general category is “mathematics” then “matrices” and then “basic”.

Imports and Prefixes

Imports are a list of libraries that your program uses. Each line is like the following:

["n", "no.inductive.idea10.programs", "numbers", "0.1.19"]

The first string is the prefix. This string will be prepended to the library name, all functions and all structures. For example, the library will be renamed “nnumbers”, and the function StringToNumberArray will be renamed nStringToNumberArray, etc. Then comes the library namespace, name and version.

The progsbase tool will compute all required dependencies and their prefixes. Here is the result for running

progsbase importdeps Java IDE

on the above example. The resolution is transitive, already added libraries are not included a second time. In the above example, the transitive closure contains 32 libraries, but only 11 were unique. Notice that you could specify another language in the command. This is a unique progsbase feature.

 + no.inductive.libraries PolynomialSolver v0.1.9
+ no.inductive.libraries Polynomials v0.1.21
+ no.inductive.idea10.programs mmath v0.1.18
+ no.inductive.idea10.programs references v0.1.5
+ no.inductive.idea10.programs references v0.1.5 (already added)
+ no.inductive.idea10.programs lists v0.1.10
+ no.inductive.idea10.programs references v0.1.5 (already added)
+ no.inductive.idea10.programs arrays v0.9.7
+ no.inductive.idea10.programs references v0.1.5 (already added)
+ no.inductive.idea10.programs nnumbers v0.1.19
+ no.inductive.idea10.programs strings v0.9.9
+ no.inductive.idea10.programs lists v0.1.10 (already added)
+ no.inductive.idea10.programs references v0.1.5 (already added)
+ no.inductive.libraries charCharacters v0.1.3
+ no.inductive.idea10.programs references v0.1.5 (already added)
+ no.inductive.idea10.programs math v0.1.18 (already added)
+ no.inductive.libraries cComplexNumbers v0.1.13
+ no.inductive.idea10.programs mathmath v0.1.18 (already added)
+ no.inductive.idea10.programs numbers v0.1.19 (already added)
+ no.inductive.idea10.programs lists v0.1.10 (already added)
+ no.inductive.idea10.programs math v0.1.18 (already added)
+ no.inductive.libraries cComplexNumbers v0.1.13 (already added)
+ no.inductive.idea10.programs references v0.1.5 (already added)
+ no.inductive.idea10.programs references v0.1.5 (already added)
+ no.inductive.idea10.programs mathmath v0.1.18 (already added)
+ no.inductive.libraries cComplexNumbers v0.1.13 (already added)
+ no.inductive.libraries pPolynomials v0.1.21 (already added)
+ no.inductive.idea10.programs strings v0.9.9 (already added)
+ no.inductive.idea10.programs nnumbers v0.1.19 (already added)
+ no.inductive.idea10.programs testing v0.1.8
+ no.inductive.idea10.programs references v0.1.5 (already added)
+ no.inductive.idea10.programs arrays v0.9.7 (already added)
 Imported no.inductive.libraries PolynomialSolver 0.1.9
Imported no.inductive.idea10.programs testing 0.1.8
Imported no.inductive.libraries Polynomials 0.1.21
Imported no.inductive.idea10.programs math 0.1.18
Imported no.inductive.idea10.programs lists 0.1.10
Imported no.inductive.idea10.programs numbers 0.1.19
Imported no.inductive.libraries ComplexNumbers 0.1.13
Imported no.inductive.idea10.programs references 0.1.5
Imported no.inductive.idea10.programs arrays 0.9.7
Imported no.inductive.idea10.programs strings 0.9.9
Imported no.inductive.libraries Characters 0.1.3

Libraries that only differ in their version must generally be prefixed differently to avoid name conflicts.

Development imports are only used for testing a library. Thus, if a library depends on another library, its development imports are not imported.

If there is a name conflict between libraries that are indirect dependencies, they can still be given another prefix. This is done in the reprefix section.

Owner

The owner of a library is the only one allowed to publish a new version of the library. If the library is set to private, only the owner can import it as a dependency.

Contact Information

We would be more than happy to help you. Our opening hours are 9–15 (CET).

[email protected]

📞 (+47) 93 68 22 77

Nils Bays vei 50, 0876 Oslo, Norway

Copyright © 2018-24 progsbase.com by Inductive AS.