Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8237069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:20:52+00:00 2026-06-07T19:20:52+00:00

I’m trying to extend Jan Berkel’s Android Plugin for Scala that uses SBT .

  • 0

I’m trying to extend Jan Berkel’s Android Plugin for Scala that uses SBT.

I have similar actions and settings like already defined android:install-device and android:install-emulator.
Let them be called android:dev-install-device and android:dev-install-emulator.

I have added new keys in AndroidKeys.scala:

val devInstallDevice = TaskKey[Unit]("dev-install-device")
val devInstallEmulator = TaskKey[Unit]("dev-install-emulator")

val devStartDevice = TaskKey[Unit]("dev-start-device", "Start package on device after installation")
val devStartEmulator = TaskKey[Unit]("dev-start-emulator", "Start package on emulator after installation")

I have also added things in AndroidLaunch.scala:

lazy val settings: Seq[Setting[_]] =
    //AndroidInstall.settings ++
    AndroidFastInstall.settings ++
    inConfig(Android) (Seq (
        devStartDevice <<= startTask(false),
        devStartEmulator <<= startTask(true),
        //startDevice <<= startTask(false),
        //startEmulator <<= startTask(true),

        devStartDevice <<= devStartDevice dependsOn devInstallDevice,
        devStartEmulator <<= devStartEmulator dependsOn devInstallEmulator
        //startDevice <<= startDevice dependsOn installDevice,
        //startEmulator <<= startEmulator dependsOn installEmulator
    ))

The problem is, if I want my own tasks to be available, I have to comment out the original, standard ones, which I don’t want to.

Is there anything I’m overlooking?


Update:
I’ve tried different order of settings.

When AndroidFastInstall comes before AndroidInstall, AndroidInstall is executed regardless I call android:install-device or android:dev-install-device.

  lazy val settings: Seq[Setting[_]] =
    AndroidFastInstall.settings ++
    inConfig(Android) (Seq (
      devStartDevice <<= devStartTask(false),
      devStartEmulator <<= devStartTask(true),

      devStartDevice <<= devStartDevice dependsOn devInstallDevice,
      devStartEmulator <<= devStartEmulator dependsOn devInstallEmulator
    ))++
    AndroidInstall.settings ++
    inConfig(Android) (Seq (
      startDevice <<= startTask(false),
      startEmulator <<= startTask(true),

      startDevice <<= startDevice dependsOn installDevice,
      startEmulator <<= startEmulator dependsOn installEmulator
    )) 

When AndroidInstall comes before AndroidFastInstall, AndroidFastInstall is executed regardless I call android:install-device or android:dev-install-device.

  lazy val settings: Seq[Setting[_]] =
    AndroidInstall.settings ++
    inConfig(Android) (Seq (
      startDevice <<= startTask(false),
      startEmulator <<= startTask(true),

      startDevice <<= startDevice dependsOn installDevice,
      startEmulator <<= startEmulator dependsOn installEmulator
    )) ++
    AndroidFastInstall.settings ++
    inConfig(Android) (Seq (
      devStartDevice <<= devStartTask(false),
      devStartEmulator <<= devStartTask(true),

      devStartDevice <<= devStartDevice dependsOn devInstallDevice,
      devStartEmulator <<= devStartEmulator dependsOn devInstallEmulator
    ))

It appears that the last ones added always cover the visibilty of those prior to them.
Does anyone know the solution to this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:20:54+00:00Added an answer on June 7, 2026 at 7:20 pm

    This question needs some additional information.

    Here’s the complete source code: https://github.com/ioreskovic/android-plugin

    Apparently, you’ve copied the settings from in AndroidInstall to devSettings in AndroidFastInstall. You then added the new task keys in AndroidLaunch.

    The problem you are having is that apparently calling dev-install-device does exactly the same thing as install-device. This is not because one covers the visibility of the other (they are both visible, it’s just that they do the same thing). The problem is that they both depend on the same set of other task keys, and you change those task keys twice – the last change shadows the one before.

    More specifically, your problem is here:

    lazy val settings: Seq[Setting[_]] =
      AndroidFastInstall.devSettings ++
      ...
      AndroidInstall.settings ++
      ...
    

    Take a look what’s inside of these settings and devSettings sequences:

    AndroidFastInstall:

    lazy val devSettings: Seq[Setting[_]] = inConfig(Android) (devInstallerTasks ++ Seq (
      uninstallEmulator <<= devUninstallTask(emulator = true),
      uninstallDevice <<= devUninstallTask(emulator = false),
      ...
      >>>   proguard <<= proguardTask   <<<
    

    AndroidInstall:

    lazy val settings: Seq[Setting[_]] = inConfig(Android) (installerTasks ++ Seq (
      uninstallEmulator <<= uninstallTask(emulator = true),
      uninstallDevice <<= uninstallTask(emulator = false),
      ...
      >>>   proguard <<= proguardTask   <<<
    

    Here you’re redefining a task key called proguard which both dev-install-device and install-device depend on. The first proguardTask method is in AndroidFastInstall, the second is in AndroidInstall and they do different things. Since you call the second one last, it redefines what the proguard task means.

    (I’m drawing attention to the proguard task key which both dev-install-device and install-device transitively depend on, but there are other examples of such task keys in settings and devSettings.)

    To understand this better, you have to understand what settings and tasks really are and how they work:

    • https://github.com/harrah/xsbt/wiki/Getting-Started-Basic-Def

    • https://github.com/harrah/xsbt/wiki/Getting-Started-More-About-Settings

    • https://github.com/harrah/xsbt/wiki/Getting-Started-Custom-Settings

    See “Defining a key” for examples of how to declare a task key.

    See “Implementing a task” and “Computing a value based on other keys’ values: <<=” for examples of how to implement a task.

    This gist of it is – a task key is first declared and implemented later via := and <<=. The <<= may be called multiple times – each call to <<= reimplements the task key.

    To make your problems go away, create separate proguard keys for dev and regular versions of your tasks. And do the same thing for the conflicting tasks other than proguard.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.