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

Multiple java project translation and compilation #51

Closed
advayDev1 opened this issue May 9, 2015 · 11 comments
Closed

Multiple java project translation and compilation #51

advayDev1 opened this issue May 9, 2015 · 11 comments
Assignees
Milestone

Comments

@advayDev1
Copy link
Contributor

I have two projects, say 2 java gradle projects libx and appx. They live under one root gradle project, and therefore appx has a 'compile' dependency on libx. Both libx and appx need to be converted to objc.

Ideally, libx's output directory for j2objcCopy would become an additional include directory for appx's j2objcCompile. In addition, .a files from compiling libx, would be available for linking into appx's j2objcTest phase. libx's jar file would be on the classpath for appx's translation. All the tasks should have inter-project dependencies set correctly (I'm guessing I'm going to need to add a new flavor of dependency like 'j2objc').

This should be all done automatically, without --build-closure (a crutch that is getting less useful as my project graph gets more complicated), and in a hermetic environment (no copying files to j2objc's main /include and /lib directories). Why doesn't this work out of the box and what needs fixing?

  • no way to add additional include directories for j2objcCompile
  • j2objc* tasks between projects do not have dependency edges (i.e. appx:j2objc* depends only on libx:compile not on libx:j2objcTranslate)
  • no way to specify classpath libraries that are not either in $J2OBJC_HOME/lib or in $PROJECT/lib. (gradle doesn't use $PROJECT/lib to save away a peer, dependent project's jar output)
  • j2objc compile tasks don't create/save away .a objects anywhere permanently
  • no way to specify objc .a objects to link that are not in $J2OBJC_HOME/lib
  • input directories for appx's j2objc tasks need to be set so as to include the output directories of libx's j2objc tasks. (this ensures gradle runs the right tasks on file update).

Thoughts? I'm working on figuring this out on my own in my private codebase, if I succeed I'll try to issue a pull request as long as things haven't diverged too far by then.

@advayDev1
Copy link
Contributor Author

(I'm aware the shortcut way of doing this is a single j2objc project that just accumulates the src/main/java directories of all possible source directories of all possible projects, but that prevents me from building/updating my many independent libraries separately).

@confile
Copy link
Contributor

confile commented May 9, 2015

I have a similar setup. Just include lib in your main project and translate the main project. This issue is not related to this plugin.

@advayDev1
Copy link
Contributor Author

Can you expound on 'include lib in your main project'? You mean combine the sources of two different projects?

@confile
Copy link
Contributor

confile commented May 9, 2015

I included the lib source in the main project.

@advayDev1
Copy link
Contributor Author

Yeah I don't want to do that, and I shouldn't have to. It should be possible to build 2 separate java source projects with gradle dependencies between them, and properly setup the j2objc tasks for that. (in my case my codebase has many separate java libraries each of which can and should be independent objc libraries).

@confile
Copy link
Contributor

confile commented May 9, 2015

Which type of MVP framework do you use?

@advayDev1
Copy link
Contributor Author

None. I'm not sure how that's relevant?

I have lots and lots of separate gradle subprojects, each of them used by different subsystems, and different parts of the organization.

@confile
Copy link
Contributor

confile commented May 9, 2015

It is not! just for interest.

@advayDev1
Copy link
Contributor Author

Sorry =) I get pretty adamant about preventing a bug thread from digressing.

@brunobowden
Copy link
Contributor

This is still a productive conversation. I'm learning from both of you.

On Sat, May 9, 2015 at 4:05 PM Advay Mengle notifications@github.com
wrote:

Sorry =) I get overly adamant about preventing a bug thread from
digressing.


Reply to this email directly or view it on GitHub
https://github.com/brunobowden/j2objc-gradle/issues/51#issuecomment-100558915
.

@advayDev1
Copy link
Contributor Author

Almost have this done. For me, this is the last major missing feature.

advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 12, 2015
- Users must call configureNativeBuild() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 12, 2015
- Users must call configureNativeBuild() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 12, 2015
- Users must call configureNativeBuild() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 12, 2015
- Users must call configureNativeBuild() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 12, 2015
- Users must call configureNativeBuild() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths
- disable shared library tasks by default; 50% faster.

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 12, 2015
- Users must call configureNativeBuild() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths
- disable shared library tasks by default; 50% faster.
- fix logger.warning -> logger.warn

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 12, 2015
- Users must call configureNativeBuild() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths
- disable shared library tasks by default; 50% faster.
- fix logger.warning -> logger.warn

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 12, 2015
- Users must call configureNativeBuild() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths
- disable shared library tasks by default; 50% faster.
- fix logger.warning -> logger.warn

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 14, 2015
- Users must call configureNativeBuild() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths
- disable shared library tasks by default; 50% faster.
- fix logger.warning -> logger.warn

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 14, 2015
- Users must call finalConfigure() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths
- disable shared library tasks by default; 50% faster.
- fix logger.warning -> logger.warn

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 14, 2015
- Users must call finalConfigure() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths
- disable shared library tasks by default; 50% faster.
- fix logger.warning -> logger.warn
- support using a subset of all iOS platforms

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51, Fixes j2objc-contrib#59, Fixes j2objc-contrib#177
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 14, 2015
- Users must call finalConfigure() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths
- disable shared library tasks by default; 50% faster.
- fix logger.warning -> logger.warn
- support using a subset of all iOS platforms

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51, Fixes j2objc-contrib#59, Fixes j2objc-contrib#177

TESTED=yes
advayDev1 added a commit to madvay/j2objc-gradle that referenced this issue Jun 14, 2015
- Users must call finalConfigure() at the end of their j2objcConfig.
- dependsOnJ2objcLib with a project will automatically wire up all dependencies to another j2objc project
- extra* flags allow you to customize the objective-c builds.
- remove lib/ prefix from all translateClassPaths
- disable shared library tasks by default; 50% faster.
- fix logger.warning -> logger.warn
- support using a subset of all iOS platforms

Ugly but it works.  The inability to reconfigure a previously
created native component is an issue others are hitting too:
https://discuss.gradle.org/t/problem-with-model-block-when-switching-from-2-2-1-to-2-4/9937

Fixes j2objc-contrib#153, Fixes j2objc-contrib#51, Fixes j2objc-contrib#59, Fixes j2objc-contrib#177

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

No branches or pull requests

3 participants