Skip to content

Commit

Permalink
Merge pull request #739 from crowdin/next-v4
Browse files Browse the repository at this point in the history
feat: CLI v4
  • Loading branch information
andrii-bodnar committed May 28, 2024
2 parents 56b0c0e + eb1645b commit 326fd7d
Show file tree
Hide file tree
Showing 297 changed files with 3,724 additions and 3,328 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- 'CONTRIBUTING.md'
- 'LICENSE'
pull_request:
branches: [ 'main' ]
branches: [ 'main', 'next-v4' ]

jobs:
build:
Expand All @@ -20,12 +20,9 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 17
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Execute Gradle build
run: ./gradlew build

Expand Down Expand Up @@ -55,12 +52,9 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 17
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Run Tests
run: ./gradlew test

Expand Down Expand Up @@ -97,7 +91,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 17
cache: 'gradle'

- name: Install asciidoctor and pandoc
Expand Down Expand Up @@ -129,7 +123,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 17
cache: 'gradle'

- name: Prepare distribution
Expand All @@ -147,7 +141,7 @@ jobs:

- name: Build and install the package
run: |
sudo npm install --location=global jdeploy@4.0.22
sudo npm install --location=global jdeploy@4.0.43
npm install
jdeploy install
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 17
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Run static analysis
run: ./gradlew build staticAnalysis -P staticAnalysisMarker

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 17
cache: 'gradle'

- name: Install asciidoctor and pandoc
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 17
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Generate autocomplete script
run: |
./gradlew shadowJar
Expand Down Expand Up @@ -87,7 +84,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 17
cache: 'gradle'

- name: Generate autocomplete script
Expand All @@ -110,7 +107,7 @@ jobs:

- name: Build and install the package
run: |
sudo npm install --location=global jdeploy@4.0.22
sudo npm install --location=global jdeploy@4.0.43
npm install
jdeploy install
mv build/libs/crowdin_completion jdeploy-bundle/crowdin_completion
Expand Down Expand Up @@ -187,7 +184,7 @@ jobs:

- name: install local package
run: |
choco install jdk8
choco install temurin
choco install crowdin-cli -s . -y
- name: Choco publish
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [4.0.0](https://github.com/crowdin/crowdin-cli/compare/3.19.4...4.0.0) (2024-05-28)

* [Release Notes](https://crowdin.github.io/crowdin-cli/blog/2024/05/28/cli-v4)

## [3.19.4](https://github.com/crowdin/crowdin-cli/compare/3.19.3...3.19.4) (2024-05-16)


Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ Crowdin CLI is a command line tool that allows you to manage and synchronize you
- automate the process of updating your source files in your Crowdin project
- download translations from Crowdin and automatically save them in the correct locations
- upload all your existing translations to Crowdin in minutes
- integrate Crowdin with GIT, SVN, Mercurial, and other software
- manage your localization resources without leaving the terminal
- integrate Crowdin CLI with GitHub, GitLab, Jenkins, CircleCI, and other software

This is a cross-platform and it runs in a terminal on Linux based and macOS operating systems or in Command Prompt on Windows.
It is cross-platform and runs in a terminal on Linux-based and macOS operating systems, or in the command prompt on Windows.

<div align="center">

Expand Down Expand Up @@ -45,17 +46,12 @@ This is a cross-platform and it runs in a terminal on Linux based and macOS oper

Visit the [documentation](https://crowdin.github.io/crowdin-cli/) for more details.

## Seeking Assistance
## Seeking Assistance and Contributing

If you find any problems or would like to suggest a feature, please read the [How can I contribute](/CONTRIBUTING.md#how-can-i-contribute) section in our contributing guidelines.

Need help working with Crowdin CLI or have a question? Visit our [Community Forum](https://community.crowdin.com/) or contact [Customer Success Service](https://crowdin.com/contacts).

## Contributing

If you would like to contribute, please read the [Contributing Guidelines](/CONTRIBUTING.md).

## License

<pre>
The Crowdin CLI is licensed under the MIT License.
See the LICENSE file distributed with this work for additional
Expand Down
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import static de.fayard.refreshVersions.core.Versions.versionFor

plugins {
id 'java'
id 'com.github.johnrengelman.shadow'
id 'io.github.goooler.shadow' //TODO find alternative
id 'jacoco'
id 'com.github.spotbugs'
id 'org.asciidoctor.jvm.convert'
}

group 'com.crowdin'
version '3.19.4'
version '4.0.0'

sourceCompatibility = 1.8
sourceCompatibility = '17'

if (!hasProperty('mainClass')) {
ext.mainClass = 'com.crowdin.cli.Cli'
Expand Down Expand Up @@ -62,6 +62,10 @@ dependencies {
annotationProcessor "info.picocli:picocli-codegen:_"
}

wrapper {
gradleVersion = '8.5'
}

jar {
manifest {
attributes 'Implementation-Title': 'Crowdin CLI',
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
1 change: 1 addition & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 13 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
"type": "git",
"url": "https://github.com/crowdin/crowdin-cli.git"
},
"version": "3.19.4",
"version": "4.0.0",
"bin": {
"crowdin": "jdeploy-bundle/jdeploy.js"
},
"jdeploy": {
"jar": "dist/crowdin-cli.jar"
"jar": "dist/crowdin-cli.jar",
"javaVersion": "17"
},
"dependencies": {
"command-exists-promise": "^2.0.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/aur/pkgbuild/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Maintainer: Senya <senya at riseup.net>
pkgname=crowdin-cli
pkgver=3.19.4
pkgver=4.0.0
pkgrel=1
pkgdesc="Command line tool that allows you to manage and synchronize localization resources with your Crowdin project"
url="https://support.crowdin.com/cli-tool/"
license=('MIT')
depends=('java-runtime>=8')
makedepends=('git' 'java-environment>=8' 'grep' 'awk')
depends=('java-runtime>=17')
makedepends=('git' 'java-environment>=17' 'grep' 'awk')
conflicts=('crowdin-cli-bin')
arch=('any')
md5sums=('SKIP' 'b018bcf51df64a8e68450cd7ac0e3838')
Expand Down
4 changes: 2 additions & 2 deletions packages/chocolatey/crowdin-cli.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>crowdin-cli</id>
<version>3.19.4</version>
<version>4.0.0</version>
<packageSourceUrl>https://github.com/crowdin/crowdin-cli/tree/main/packages/chocolatey</packageSourceUrl>
<owners>crowdin</owners>
<title>Crowdin CLI (Portable)</title>
Expand All @@ -25,7 +25,7 @@
- This is a cross-platform and it runs in a terminal on Linux based and macOS operating systems or in Command Prompt on Windows. </description>
<releaseNotes>https://github.com/crowdin/crowdin-cli/releases</releaseNotes>
<dependencies>
<dependency id="jdk8" />
<dependency id="jdk17" />
</dependencies>
</metadata>
<files>
Expand Down
2 changes: 1 addition & 1 deletion packages/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine

RUN apk --no-cache add sudo openjdk11-jre --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community;
RUN apk --no-cache add sudo openjdk17-jre --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community;

ADD https://github.com/crowdin/crowdin-cli/releases/latest/download/crowdin-cli.zip /usr/

Expand Down
Loading

0 comments on commit 326fd7d

Please sign in to comment.