Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build didn't mark as fail. #217

Closed
kolard opened this issue Oct 16, 2015 · 15 comments
Closed

build didn't mark as fail. #217

kolard opened this issue Oct 16, 2015 · 15 comments

Comments

@kolard
Copy link

kolard commented Oct 16, 2015

Hi.
I've found strange issue.
I have some errors during my build, as result I see the build is "succsess", but should be "failed"
Here is console output:

...
 {my_file_path} No such file or directory

2015-10-16 13:48:41.007 xcodebuild[1430:1031613]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-8186/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/Runtime/PBXTargetBuildContext.mm:739
Details:  unexpected successful exit code from cancelled command <C0762:'CpResource Basket_Tests':P8>
Object:   <PBXTargetBuildContext: 0x7f81cd6eb3a0>
Method:   -createCommandInvocationRecordFromInvocation:
Thread:   <NSThread: 0x7f81ce4438b0>{number = 8, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **


The following build commands failed:
    CpResource  {My_file_path}
(1 failure)

Done
:keychainRemove
:archive
:package
not a device build, so no codesign and packaging needed
:calabash_build

BUILD SUCCESSFUL

Here is my gradle config for this task, may be I should add some parameter for marking build as fail?

...
task calabash_build(dependsOn:'package', type:Exec){
        description = "Performs build for calabash tests without launching Sinatra mocks service"
        dependsOn calabash_init, calabash_loc
        commandLine 'bundle', 'exec', 'calabash-ios', 'sim', 'reset'
        ext.output = {
                return errorOutput.toString()
        }
}
...
gradle.taskGraph.whenReady { taskGraph ->

        // ------------------------------------------------------------------------------------------

        if (taskGraph.hasTask(calabash) || taskGraph.hasTask(calabash_build)) {
                println "Configure device settings for the build and calabash tests"

                println "Setting xcodebuild configuration"
                xcodebuild {
                                sdk = 'iphonesimulator'
                                target = ''my_target"
                                scheme = ''my_scheme"
                                workspace = 'my.xcworkspace'
                                configuration = 'Calabash'
                        }
                }
...
@renep
Copy link
Contributor

renep commented Oct 17, 2015

Maybe duplicate of #214 which is fixed with 0.12.0?

@kolard
Copy link
Author

kolard commented Oct 17, 2015

May be. We use 0.11.6 now. I'll try 0.12.0

@kolard
Copy link
Author

kolard commented Oct 19, 2015

I've tied to use 0.12.* version, but I have a very strange error.

anton$ gradle clean

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/anton/iphone_test/build.gradle' line: 15

* What went wrong:
A problem occurred evaluating root project 'iphone_test'.
> Plugin with id 'org.openbakery.xcode-plugin' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 6.345 secs

Build.gradle includes only plugin initialization.

buildscript {
        repositories {
                maven {
                        url('http://repository.openbakery.org/')
                }
                mavenCentral()
  }

        dependencies {
            classpath "org.openbakery:xcode-plugin:0.12.+"
        }

}

apply plugin: 'org.openbakery.xcode-plugin'

If I use
classpath "org.openbakery:xcode-plugin:0.11.+"
instead of
classpath "org.openbakery:xcode-plugin:0.12.+"

It works fine.

@renep
Copy link
Contributor

renep commented Oct 19, 2015

Please try again with --refresh-dependencies (once) so that the jar gets load again:
e.g.
gradle tasks --refresh-dependencies

(something was wrong on my web server, you also can use: https://plugins.gradle.org/plugin/org.openbakery.xcode-plugin)

@kolard
Copy link
Author

kolard commented Oct 19, 2015

Thanks,
"-refresh-dependencies" helps with this problem.
But I have new one)
Looks like with new version my build doesn't work.
Config for 0.11.6 in my first post
Here Is my config: for 0.12

        // ------------------------------------------------------------------------------------------

        if (taskGraph.hasTask(calabash) || taskGraph.hasTask(calabash_build)) {
                println "Configure device settings for the build and calabash tests"

                println "Setting xcodebuild configuration"
                xcodebuild {
                                //sdk = 'iphonesimulator'
                                version = "7.0"
                                type = 'ios'
                                simulator = 'true'
                                target = ''my_target"
                                scheme = ''my_scheme"
                                workspace = 'my.xcworkspace'
                                configuration = 'Calabash'
                                destination {
                                        platform = 'iOS Simulator'
                                        name = 'iPhone 6s'
                                        os='9.*'
                                }
                        }
                }

In console I see next

...
:calabash_loc
:keychainCreate SKIPPED
:provisioningInstall SKIPPED
:package
not a device build, so no codesign and packaging needed
:keychainRemove
:calabash_build

BUILD SUCCESSFUL

Total time: 59.681 secs

But "build" folder wasn't created and no any builds.

@renep
Copy link
Contributor

renep commented Oct 19, 2015

the 'package' task does not have a dependency to 'archive' anymore. Therefor you need to run 'gradle archive package'.

The reason is, that I had the case were I simply want to package an existing xcarchive.

@kolard
Copy link
Author

kolard commented Oct 19, 2015

I don't need package for this task. Looks like my "calabash_build" didn't create build as it was with previous version.
calabash_build should run :xcodebuild and :archive.

@renep
Copy link
Contributor

renep commented Oct 19, 2015

As I see, you have defined the calabash_build task to depend the package task. Therefor you should change it to depend on the archive task

@kolard
Copy link
Author

kolard commented Oct 19, 2015

...
task calabash_build(dependsOn:'package', type:Exec){
        description = "Performs build for calabash tests without launching Sinatra mocks service"
        dependsOn calabash_init, calabash_loc
        commandLine 'bundle', 'exec', 'calabash-ios', 'sim', 'reset'
        ext.output = {
                return errorOutput.toString()
        }
}
...
        // ------------------------------------------------------------------------------------------

        if (taskGraph.hasTask(calabash) || taskGraph.hasTask(calabash_build)) {
                println "Configure device settings for the build and calabash tests"

                println "Setting xcodebuild configuration"
                xcodebuild {
                                //sdk = 'iphonesimulator'
                                version = "7.0"
                                type = 'ios'
                                simulator = 'true'
                                target = ''my_target"
                                scheme = ''my_scheme"
                                workspace = 'my.xcworkspace'
                                configuration = 'Calabash'
                                destination {
                                        platform = 'iOS Simulator'
                                        name = 'iPhone 6s'
                                        os='9.*'
                                }
                        }
                }

@renep
Copy link
Contributor

renep commented Oct 19, 2015

I have updated the last post... -> change dependsOn to 'archive'

@kolard
Copy link
Author

kolard commented Oct 20, 2015

Thanks a lot.
Looks like it works now and I have to do some refactoring old code of other tasks.

@renep renep closed this as completed Oct 20, 2015
@renep
Copy link
Contributor

renep commented Oct 20, 2015

I'm wondering if you can provide some example of a calabash test that is executed with gradle. Maybe use one of the examples provided here with the plugin. This would be very interesting ;-)

Maybe I could add calabash support to the plugin then.

@kolard
Copy link
Author

kolard commented Oct 21, 2015

I still have some problems with new version of plugin.
Btw about calabash. We use cucmber + calabash, and gradle just create command for running via CMD.
CMD string look like like

bundle exec cucumber APP='./build/sym/Calabash-iphonesimulator/app_name.app' DEVICE_TARGET="iPhone 6 (9.0)" --tags @my_tag

@renep
Copy link
Contributor

renep commented Oct 21, 2015

What problems?

@kolard
Copy link
Author

kolard commented Oct 21, 2015

When I use dependsOn:'archive' in stead of dependsOn:'package'. My build fails for both plugin versions.
With 0.12.0 looks like the problem is spaces in filename.

   ERROR - Linking: build/obj/myapp.build/Calabash-iphonesimulator/My_app_Calabash.build/Objects-normal/i386/MY\ 
   ERROR - Linking: build/obj/myapp.build/Calabash-iphonesimulator/My_app_Calabash.build/Objects-normal/x86_64/MY\

Name is "My app.app"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants