Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Support sharing resources between Android modules #34

Open
borisf opened this issue Nov 21, 2017 · 8 comments
Open

Support sharing resources between Android modules #34

borisf opened this issue Nov 21, 2017 · 8 comments

Comments

@borisf
Copy link
Contributor

borisf commented Nov 21, 2017

Make Android modules be dependent on other Andorid/Java modules:

  • Calling methods
  • Using layouts
  • Using images
@borisf
Copy link
Contributor Author

borisf commented Nov 22, 2017

in build.gradle

dependencies {
              ...
                implementation project(':module4')
                // generated
                compile project(':androidAppModule1')

            }

And in activity

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Set the layout for this activity.  You can find it
        // in res/layout/hello_activity.xml
        setContentView(R.layout.activity_main0);

        // generated source
        module1packageJava0.Foo0 zzz = new module1packageJava0.Foo0();
        zzz.foo0();

        // generated resources
        setContentView(com.androidAppModule1.R.layout.activity_main2);
    }

@borisf
Copy link
Contributor Author

borisf commented Nov 22, 2017

cc @NikitaKozlov

@NikitaKozlov
Copy link
Contributor

Is this what is currently generated?

@borisf
Copy link
Contributor Author

borisf commented Nov 22, 2017

These are my tests, to support the feature fully we need to upgrade the dependencies system, for Android modules to be dependent on other Android modules

@NikitaKozlov
Copy link
Contributor

Oh, I see. You want us to generate this kind of code? But why then it calls setContentView twice?

@borisf
Copy link
Contributor Author

borisf commented Nov 22, 2017

This is the minimal code I generated and updated by hand to understand the scope of generated code, thus setContentView twice is the minimal code to actually use resources from another Android module and activate relevant android gradle plugin mechanisms

@NikitaKozlov
Copy link
Contributor

#46

@NikitaKozlov
Copy link
Contributor

Done in "dev" branch

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

No branches or pull requests

2 participants