Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-19626

Android Test Project that targets itself fails in 'Create Android Buildfiles'

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Linux

      I have a Android TestProject and it has targetPackage of the instrumentation set to itself. This way I can easily test a android library that is referenced by this project and tested.

      The buildstep "Create Android Buildfiles" fails for this project with:
      "No related app project found; cannot create build files for test project NAME "

      I think this is caused by the mentioned self-targeting.

          [JENKINS-19626] Android Test Project that targets itself fails in 'Create Android Buildfiles'

          How do you normally build this test app on the command line with Ant?

          I tried briefly creating a test project which references itself, including an ant.properties file with the contents tested.project.dir=., but I just got Ant failures like "subant task calling its own parent target".

          Christopher Orr added a comment - How do you normally build this test app on the command line with Ant? I tried briefly creating a test project which references itself, including an ant.properties file with the contents tested.project.dir=. , but I just got Ant failures like "subant task calling its own parent target".

          With self-targeting I was refering to the "instrumentation" target in the manifest.
          I checked the code in github, and see that it just searches for a nearby app project. For me the app project and the testproject are integrated into one.
          I now worked around by manually adding a standard android generated build.xml and copy the local.properties from the library project that does get handled ok.

          Peter de Kraker added a comment - With self-targeting I was refering to the "instrumentation" target in the manifest. I checked the code in github, and see that it just searches for a nearby app project. For me the app project and the testproject are integrated into one. I now worked around by manually adding a standard android generated build.xml and copy the local.properties from the library project that does get handled ok.

          Ok, so I guess ideally this type of self-referencing project should be created using `android update project`, rather than `android update test-project`.

          Christopher Orr added a comment - Ok, so I guess ideally this type of self-referencing project should be created using `android update project`, rather than `android update test-project`.

            Unassigned Unassigned
            peterdk Peter de Kraker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: