Skip to content

Commit

Permalink
Update option step and create new option for select build system with… (
Browse files Browse the repository at this point in the history
#53)

* Update option step and create new option for select build system without arguments

* Bumping version to 1.2.2

* Fix titles and change mixing types on step

* Enable JDK 8 for tests

* Fix Android AAB test

Co-authored-by: Olivér Falvai <oliver.falvai@bitrise.io>
  • Loading branch information
manuelabarca and ofalvai committed Oct 6, 2021
1 parent 21e2c4a commit 1535ba3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
## Changelog (Current version: 1.2.1)
## Changelog (Current version: 2.0.0)

-----------------

### 2.0.0 (2021 Oct 05)

* [00e8843] Bumping version to 2.0.0
* [840a266] Update option step and create new option for select build system without arguemnts (#50)

### 1.2.1 (2018 Nov 07)

* [7faed8e] Prepare for 1.2.1
Expand Down
9 changes: 6 additions & 3 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git

app:
envs:
- STEP_VERSION: 1.2.1
- STEP_VERSION: 2.0.0
- ORIG_BITRISE_SOURCE_DIR: $BITRISE_SOURCE_DIR

workflows:
Expand Down Expand Up @@ -49,6 +49,9 @@ workflows:

_common:
steps:
- set-java-version:
inputs:
- set_java_version: 8
- script:
inputs:
- content: |-
Expand Down Expand Up @@ -120,10 +123,10 @@ workflows:
exit 1
fi
- path::./:
title: Cordova archive android bubdle
title: Cordova archive android bundle
inputs:
- platform: android
- options: -- --packageType="bundle"
- android_app_type: aab
- target: emulator
- cordova_version:
- run_cordova_prepare: ${RUN_PREPARE_IN_ARCHIVE}
Expand Down
11 changes: 10 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"errors"
"fmt"
"github.com/kballard/go-shellquote"
"os"
"path/filepath"
"strings"
Expand All @@ -20,6 +19,7 @@ import (
"github.com/bitrise-io/go-utils/sliceutil"
"github.com/bitrise-io/go-utils/ziputil"
"github.com/bitrise-steplib/steps-cordova-archive/cordova"
"github.com/kballard/go-shellquote"
)

const (
Expand All @@ -44,6 +44,7 @@ type config struct {
CordovaVersion string `env:"cordova_version"`
WorkDir string `env:"workdir,dir"`
Options string `env:"options"`
BuildSystem string `env:"build_system,opt[legacy,modern]"`
DeployDir string `env:"BITRISE_DEPLOY_DIR"`
UseCache bool `env:"cache_local_deps,opt[true,false]"`
AndroidAppType string `env:"android_app_type,opt[apk,aab]"`
Expand Down Expand Up @@ -259,6 +260,14 @@ func main() {
builder.SetCustomOptions(options...)
}

if configs.BuildSystem == "legacy" {
legacyQuery := "--buildFlag='-UseModernBuildSystem=0'"
builder.SetCustomOptions(legacyQuery)
} else if configs.BuildSystem == "modern" {
modernQuery := "--buildFlag='-UseModernBuildSystem=1'"
builder.SetCustomOptions(modernQuery)
}

builder.SetBuildConfig(configs.BuildConfig)

// cordova prepare
Expand Down
16 changes: 13 additions & 3 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,29 @@ inputs:
description: |-
Root directory of your Cordova project, where your Cordova config.xml exists.
is_required: true
- options: --buildFlag="-UseModernBuildSystem=0"
- options:
opts:
title: "Options to append to the cordova-cli build command"
description: |-
Use this input to specify custom options, to append to the end of the cordova-cli build command.
The new Xcode build system is now supported in cordova-ios@5.0.0 (https://github.com/apache/cordova-ios/issues/407).
To use the legacy build system add `--buildFlag="-UseModernBuildSystem=0"` to the options string.
Example:
- `--browserify`
`cordova build [OTHER_PARAMS] [options]`
- build_system: "modern"
opts:
title: "Xcode build system"
description: |-
The Xcode build system to use.
- legacy: Use the legacy build system.
- modern: Use the new Xcode build system.
value_options:
- legacy
- modern
is_required: true
- cache_local_deps: "false"
opts:
category: Cache
Expand Down

0 comments on commit 1535ba3

Please sign in to comment.