From 1616fd5544110436571fdfa2e9b15e2e7ba2a9d9 Mon Sep 17 00:00:00 2001 From: Elia Migliore Date: Mon, 9 Jan 2023 17:38:15 +0100 Subject: [PATCH] coursier: add new documentation pages (#9728) * coursier: add new documentation pages * fixing ci errors * fixing ci errors * Update pages/common/cs-complete-dep.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-complete-dep.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-complete-dep.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-fetch.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-install.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-fetch.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-install.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-install.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-install.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-install.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-fetch.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-fetch.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-fetch.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-install.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-install.md Co-authored-by: Emily Grace Seville * fix other typo * Update pages/common/cs-complete-dep.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-java.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-java.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-java.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-launch.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-launch.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-launch.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-launch.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-install.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-resolve.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-resolve.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-resolve.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-resolve.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-resolve.md Co-authored-by: Emily Grace Seville * Update pages/common/cs.md Co-authored-by: Emily Grace Seville * Update pages/common/cs.md Co-authored-by: Emily Grace Seville * Update pages/common/cs.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-resolve.md Co-authored-by: Emily Grace Seville * Update pages/common/cs.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-java.md Co-authored-by: Emily Grace Seville * Update pages/common/cs-resolve.md Co-authored-by: Emily Grace Seville * fix error Co-authored-by: Emily Grace Seville --- pages/common/cs-complete-dep.md | 20 ++++++++++++++++++ pages/common/cs-fetch.md | 28 +++++++++++++++++++++++++ pages/common/cs-install.md | 36 +++++++++++++++++++++++++++++++++ pages/common/cs-java.md | 32 +++++++++++++++++++++++++++++ pages/common/cs-launch.md | 20 ++++++++++++++++++ pages/common/cs-resolve.md | 28 +++++++++++++++++++++++++ pages/common/cs.md | 29 ++++++++++++++++++++++++++ 7 files changed, 193 insertions(+) create mode 100644 pages/common/cs-complete-dep.md create mode 100644 pages/common/cs-fetch.md create mode 100644 pages/common/cs-install.md create mode 100644 pages/common/cs-java.md create mode 100644 pages/common/cs-launch.md create mode 100644 pages/common/cs-resolve.md create mode 100644 pages/common/cs.md diff --git a/pages/common/cs-complete-dep.md b/pages/common/cs-complete-dep.md new file mode 100644 index 000000000..638870503 --- /dev/null +++ b/pages/common/cs-complete-dep.md @@ -0,0 +1,20 @@ +# cs complete dep + +> Allows the developer to search for libraries without searching directly on the web but from the command line. +> More information: . + +- Print which artifacts are published under a specific Maven group identifier: + +`cs complete-dep {{group_id}}` + +- List published library versions under a specific Maven group identifier and an artifact one: + +`cs complete-dep {{group_id}}:{{artifact_id}}` + +- Print which artifacts are pubblished under a given Maven groupId searching in the ivy2local: + +`cs complete-dep {{group_id}} --repository ivy2local` + +- List published artifacts under a Maven group identifier searching in a specific repository and credentials: + +`cs complete-dep {{group_id}}:{{artifact_id}} --repository {{repository_url}} --credentials {{user}}:{{password}}` diff --git a/pages/common/cs-fetch.md b/pages/common/cs-fetch.md new file mode 100644 index 000000000..046b336ae --- /dev/null +++ b/pages/common/cs-fetch.md @@ -0,0 +1,28 @@ +# cs fetch + +> Fetch fetches the JARs of one or more dependencies. +> More information: . + +- Fetch a specific version of a jar: + +`cs fetch {{group_id}}:{{artifact_id}}:{{artifact_version}}` + +- Fetch a package and evaluate the classpath corresponding to the selected package in an env var: + +`CP="$(cs fetch --classpath org.scalameta::scalafmt-cli:latest.release)"` + +- Fetch a source of a specific jar: + +`cs fetch --sources {{group_id}}:{{artifact_id}}:{{artifact_version}}` + +- Fetch the javadoc jars: + +`cs fetch --javadoc {{group_id}}:{{artifact_id}}:{{artifact_version}}` + +- Fetch dependency with javadoc jars and source jars: + +`cs fetch --default={{true}} --sources --javadoc {{group_id}}:{{artifact_id}}:{{artifact_version}}` + +- Fetch jars coming from dependency files: + +`cs fetch {{--dependency-file path/to/file1 --dependency-file path/to/file2 ...}}` diff --git a/pages/common/cs-install.md b/pages/common/cs-install.md new file mode 100644 index 000000000..538ba5165 --- /dev/null +++ b/pages/common/cs-install.md @@ -0,0 +1,36 @@ +# cs install + +> Install an application in the installation directory onfigured when installing `cs` (to enable the binary to be loaded add to your `.bash_profile` the `$ eval "$(cs install --env)"` command). +> More information: . + +- Install a specific application: + +`cs install {{application_name}}` + +- Install a specific version of an application: + +`cs install {{application_name}}:{{application_version}}` + +- Search an application by a specific name: + +`cs search {{application_partial_name}}` + +- Update a specific application if available: + +`cs update {{application_name}}` + +- Update all the installed applications: + +`cs update` + +- Uninstall a specific application: + +`cs uninstall {{application_name}}` + +- List all installed applications: + +`cs list` + +- Pass specific java options to an installed application: + +`{{application_name}} {{-Jjava_option_name1=value1 -Jjava_option_name2=value2 ...}}` diff --git a/pages/common/cs-java.md b/pages/common/cs-java.md new file mode 100644 index 000000000..2baf08d0d --- /dev/null +++ b/pages/common/cs-java.md @@ -0,0 +1,32 @@ +# cs java + +> The java and java-home commands fetch and install JVMs. The java command runs them too. +> More information: . + +- Call the java version by using coursier: + +`cs java -version` + +- Call a specific java version with custom properties using coursier: + +`cs java --jvm {{jvm_name}}:{{jvm_version}} -Xmx32m -X{{another_jvm_opt}} -jar {{path/to/jar_name.jar}}` + +- List all the available JVM in the coursier default index: + +`cs java --available` + +- List all the installed JVM in the system with his own location: + +`cs java --installed` + +- Set the a specific JVM as one-off "default" for the shell instance: + +`cs java --jvm {{jvm_name}}:{{jvm_version}} --env` + +- Revert the changes for the default JVM settings: + +`eval "$(cs java --disable)"` + +- Set a specific JVM as default for the whole system: + +`cs java --jvm {{jvm_name}}:{{jvm_version}} --setup` diff --git a/pages/common/cs-launch.md b/pages/common/cs-launch.md new file mode 100644 index 000000000..508c05118 --- /dev/null +++ b/pages/common/cs-launch.md @@ -0,0 +1,20 @@ +# cs launch + +> Launch an application from the name directly from one or more Maven dependencies without the need of installing it. +> More information: . + +- Launch a specific application with arguments: + +`cs launch {{application_name}} -- {{arg1 arg2 ...}}` + +- Launch a specific application version with arguments: + +`cs launch {{application_name}}:{{application_version}} -- {{arg1 arg2 ...}}` + +- Launch a specific version of an application specifying which is the main file: + +`cs launch {{group_id}}:{{artifact_id}}:{{artifact_version}} --main-class {{path/to/main_class_file}}` + +- Launch an application with specific java options and a jvm memory ones: + +`cs launch --java-opt {{-Doption_name1:option_value1 -Doption_name2:option_value2 ...}} --java-opt {{-Xjvm_option1 -Xjvm_option2 ...}} {{application_name}}` diff --git a/pages/common/cs-resolve.md b/pages/common/cs-resolve.md new file mode 100644 index 000000000..ecf85af3d --- /dev/null +++ b/pages/common/cs-resolve.md @@ -0,0 +1,28 @@ +# cs resolve + +> Resolve lists the transitive dependencies of one or more other dependencies. +> More information: . + +- Resolve lists of transitive dependencies of two dependencies: + +`cs resolve {{group_id1}}:{{artifact_id1}}:{{artifact_version1}} {{group_id2}}:{{artifact_id2}}:{{artifact_version2}}` + +- Resolve lists of transitive dependencies of a package by the dependency tree: + +`cs resolve --tree {{group_id}}:{{artifact_id}}:{{artifact_version}}` + +- Resolve dependency tree in a reverse order (from a dependency to its dependencies): + +`cs resolve --reverse-tree {{group_id}}:{{artifact_id}}:{{artifact_version}` + +- Print all the libraries that depends on a specific library: + +`cs resolve {{group_id}}:{{artifact_id}}:{{artifact_version}} --what-depends-on {{searched_group_id}}:{{searched_artifact_id}}` + +- Print all the libraries that depends on a specific library version: + +`cs resolve {{group_id}}:{{artifact_id}}:{{artifact_version}} --what-depends-on {{searched_group_id}}:{{searched_artifact_id}}{{searched_artifact_version}}` + +- Print eventual conflicts between a set of packages: + +`cs resolve --conflicts {{group_id1:artifact_id1:artifact_version1 group_id2:artifact_id2:artifact_version2 ...}}` diff --git a/pages/common/cs.md b/pages/common/cs.md new file mode 100644 index 000000000..ecc4c9d99 --- /dev/null +++ b/pages/common/cs.md @@ -0,0 +1,29 @@ +# coursier + +> Application and artifact manager for the Scala language, it can install Scala applications and setup your Scala development environment. +> Some subcommands such as `install`, `launch`, `java`, `fetch`, `resolve`, `complete-dep`, etc. have their own usage documentation, accessible via `tldr cs subcommand`. +> More information: . + +- Display version: + +`cs version` + +- Show a list of the installed applications: + +`cs list` + +- Install a specific application: + +`cs install {{application_name}}` + +- Uninstall a specific application: + +`cs uninstall {{application_name}}` + +- Setup machine for the Scala development: + +`cs setup` + +- Update all the installed applications: + +`cs update`