Skip to content

Commit

Permalink
bitrise-init update (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
godrei authored Mar 17, 2017
1 parent 80e3096 commit ff417a1
Show file tree
Hide file tree
Showing 13 changed files with 766 additions and 1,207 deletions.
2 changes: 1 addition & 1 deletion deplock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dep_locks": [
{
"url": "https://github.com/bitrise-core/bitrise-init.git",
"revision": "39458b2137dbdb31f2bedfb7b5cd6ac3fee3e504"
"revision": "9d8de8306440320cc3f714878c49c5e5b17c6fec"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,34 @@ func TestAndroid(t *testing.T) {
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(androidNonExecutableGradlewResultYML), strings.TrimSpace(result))
}

t.Log("android-sdk22-no-gradlew")
{
sampleAppDir := filepath.Join(tmpDir, "android-sdk22-no-gradlew")
sampleAppURL := "https://github.com/bitrise-samples/android-sdk22-no-gradlew.git"
require.NoError(t, command.GitClone(sampleAppURL, sampleAppDir))

cmd := command.New(binPath(), "--ci", "config", "--dir", sampleAppDir, "--output-dir", sampleAppDir)
out, err := cmd.RunAndReturnTrimmedCombinedOutput()
require.NoError(t, err, out)

scanResultPth := filepath.Join(sampleAppDir, "result.yml")

result, err := fileutil.ReadStringFromFile(scanResultPth)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(sampleAppsSDK22NoGradlewResultYML), strings.TrimSpace(result))
}
}

var sampleAppsSDK22NoGradlewResultYML = `warnings:
android:
- "<b>No Gradle Wrapper (gradlew) found.</b> \nUsing a Gradle Wrapper (gradlew)
is required, as the wrapper is what makes sure\nthat the right Gradle version
is installed and used for the build. More info/guide: <a>https://docs.gradle.org/current/userguide/gradle_wrapper.html</a>"
errors:
general:
- No known platform detected`

var sampleAppsAndroid22Versions = []interface{}{
models.FormatVersion,
steps.ActivateSSHKeyVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ configs:
macos-test-config: |
format_version: %s
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
app: {}
trigger_map:
- push_branch: '*'
workflow: primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ configs:
default-macos-config: |
format_version: %s
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
app: {}
trigger_map:
- push_branch: '*'
workflow: primary
Expand Down
9 changes: 4 additions & 5 deletions go/src/github.com/bitrise-core/bitrise-init/cli/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cli

import (
"errors"
"fmt"
"os"
"path"
Expand Down Expand Up @@ -133,14 +132,14 @@ func initConfig(c *cli.Context) error {

log.Infoft("Saving outputs:")
scanResult.AddError("general", "No known platform detected")

outputPth, err := writeScanResult(scanResult, outputDir, format)
if err != nil {
log.Errorf("Failed to write output, error: %s", err)
} else {
log.Printft(" scan result: %s", outputPth)
return fmt.Errorf("Failed to write output, error: %s", err)
}

return errors.New("No known platform detected")
log.Printft(" scan result: %s", outputPth)
return nil
}

// Write output to files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ type Scanner struct {
GradleFiles []string
}

// NewScanner ...
func NewScanner() *Scanner {
return &Scanner{}
}

// Name ...
func (scanner Scanner) Name() string {
return scannerName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ type Scanner struct {
Fastfiles []string
}

// NewScanner ...
func NewScanner() *Scanner {
return &Scanner{}
}

// Name ...
func (scanner Scanner) Name() string {
return scannerName
Expand Down
Loading

0 comments on commit ff417a1

Please sign in to comment.