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

RxSwift.resourceCount not accessable #378

Closed
kbala opened this Issue Jan 1, 2016 · 20 comments

Comments

Projects
None yet
9 participants
@kbala

kbala commented Jan 1, 2016

if TRACE_RESOURCES

private let startResourceCount = RxSwift.resourceCount

endif

Says,
Module 'RxSwift' has no member named 'resourceCount'

@sergdort

This comment has been minimized.

Show comment
Hide comment
@sergdort

sergdort Jan 2, 2016

Collaborator

Please take a look on #301

Collaborator

sergdort commented Jan 2, 2016

Please take a look on #301

@kbala

This comment has been minimized.

Show comment
Hide comment
@kbala

kbala Jan 3, 2016

Hi @sergdort I set the OtherSwift Compiler Flags same as you did, still I have same issue, Please see the below SS

2016-01-03_1318

kbala commented Jan 3, 2016

Hi @sergdort I set the OtherSwift Compiler Flags same as you did, still I have same issue, Please see the below SS

2016-01-03_1318

@sergdort

This comment has been minimized.

Show comment
Hide comment
@sergdort

sergdort Jan 4, 2016

Collaborator

Hi @kbala did you make a post POD install hook ?

use_frameworks!

pod 'RxSwift'

post_install do |installer|
   installer.pods_project.targets.each do |target|
      if target.name == 'RxSwift'
         target.build_configurations.each do |config|
            if config.name == 'Debug'
               config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['-D', 'TRACE_RESOURCES']
            end
         end
      end
   end
end
Collaborator

sergdort commented Jan 4, 2016

Hi @kbala did you make a post POD install hook ?

use_frameworks!

pod 'RxSwift'

post_install do |installer|
   installer.pods_project.targets.each do |target|
      if target.name == 'RxSwift'
         target.build_configurations.each do |config|
            if config.name == 'Debug'
               config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['-D', 'TRACE_RESOURCES']
            end
         end
      end
   end
end
@singno

This comment has been minimized.

Show comment
Hide comment
@singno

singno Jan 4, 2016

I use Carthage build version: github "ReactiveX/RxSwift" ~> 2.0 . And I cann't access RxSwift. resourceCount too.

image

image

singno commented Jan 4, 2016

I use Carthage build version: github "ReactiveX/RxSwift" ~> 2.0 . And I cann't access RxSwift. resourceCount too.

image

image

@sergdort

This comment has been minimized.

Show comment
Hide comment
@sergdort

sergdort Jan 4, 2016

Collaborator

Here is screen shot from RxExample, looks like it should be -D TRACE_RESOURCES

screen shot 2016-01-04 at 11 40 43 am

Collaborator

sergdort commented Jan 4, 2016

Here is screen shot from RxExample, looks like it should be -D TRACE_RESOURCES

screen shot 2016-01-04 at 11 40 43 am

@singno

This comment has been minimized.

Show comment
Hide comment
@singno

singno Jan 4, 2016

It seems not working for me.

singno commented Jan 4, 2016

It seems not working for me.

@sergdort

This comment has been minimized.

Show comment
Hide comment
@sergdort

sergdort Jan 4, 2016

Collaborator

And it off course should be in the framework build settings. I'm not sure is it possible to do some configurations with Carthage, like with Cocoapods

screen shot 2016-01-04 at 12 38 12 pm

Collaborator

sergdort commented Jan 4, 2016

And it off course should be in the framework build settings. I'm not sure is it possible to do some configurations with Carthage, like with Cocoapods

screen shot 2016-01-04 at 12 38 12 pm

@kzaher

This comment has been minimized.

Show comment
Hide comment
@kzaher

kzaher Jan 4, 2016

Member

You can't access resourceCount with Carthage because, as far as I'm aware of, Carthage only uses release version of the binaries, and you can't specify addition compilation flags.

Once any version of RxSwift libraries is compiled without TRACE_RESOURCES Swift flag, the code that traces resources is simply not compiled inside the library.

If Carthage supported specifying additional Swift flags during compilation, that would be possible, but I'm not sure it currently supports that or is there some other way to solve that using Carthage.

Member

kzaher commented Jan 4, 2016

You can't access resourceCount with Carthage because, as far as I'm aware of, Carthage only uses release version of the binaries, and you can't specify addition compilation flags.

Once any version of RxSwift libraries is compiled without TRACE_RESOURCES Swift flag, the code that traces resources is simply not compiled inside the library.

If Carthage supported specifying additional Swift flags during compilation, that would be possible, but I'm not sure it currently supports that or is there some other way to solve that using Carthage.

@singno

This comment has been minimized.

Show comment
Hide comment
@singno

singno Jan 4, 2016

@kzaher Yes, Carthage seems can not change build setting.
@sergdort I can not set the build setting of RxSwift framework.

singno commented Jan 4, 2016

@kzaher Yes, Carthage seems can not change build setting.
@sergdort I can not set the build setting of RxSwift framework.

@ikesyo

This comment has been minimized.

Show comment
Hide comment
@ikesyo

ikesyo Jan 5, 2016

Contributor

You can use carthage build --configuration Debug.

Contributor

ikesyo commented Jan 5, 2016

You can use carthage build --configuration Debug.

@kbala

This comment has been minimized.

Show comment
Hide comment
@kbala

kbala Jan 5, 2016

yes, I run carthage build --configuration Debug

I can access the resourceCount now, and it works 👍

kbala commented Jan 5, 2016

yes, I run carthage build --configuration Debug

I can access the resourceCount now, and it works 👍

@kzaher

This comment has been minimized.

Show comment
Hide comment
@kzaher

kzaher Jan 5, 2016

Member

Thnx @ikesyo :)

Member

kzaher commented Jan 5, 2016

Thnx @ikesyo :)

@kzaher

This comment has been minimized.

Show comment
Hide comment
@kzaher

kzaher Jan 5, 2016

Member

And thnx @sergdort , helping with issues helps a lot 👍

Member

kzaher commented Jan 5, 2016

And thnx @sergdort , helping with issues helps a lot 👍

@kbala kbala closed this Jan 9, 2016

@sunflash

This comment has been minimized.

Show comment
Hide comment
@sunflash

sunflash Feb 15, 2016

carthage build --platform iOS --configuration Release-Tests
work too

sunflash commented Feb 15, 2016

carthage build --platform iOS --configuration Release-Tests
work too

@scotteg

This comment has been minimized.

Show comment
Hide comment
@scotteg

scotteg Jun 5, 2016

Collaborator

You can also quickly enable RxSwift.resourceCount by adding the TRACE_RESOURCES flag to the RxSwift target, e.g., in the Pods project, Build settings > Other Swift flags > Debug:

screenshot 2016-06-05 17 11 08

You'll just need to remember to re-enable it every time you do a pod update--which, maybe, isn't such a bad thing 😉

Collaborator

scotteg commented Jun 5, 2016

You can also quickly enable RxSwift.resourceCount by adding the TRACE_RESOURCES flag to the RxSwift target, e.g., in the Pods project, Build settings > Other Swift flags > Debug:

screenshot 2016-06-05 17 11 08

You'll just need to remember to re-enable it every time you do a pod update--which, maybe, isn't such a bad thing 😉

@scotteg scotteg reopened this Jun 5, 2016

@scotteg scotteg closed this Jun 5, 2016

@RafaelPlantard

This comment has been minimized.

Show comment
Hide comment
@RafaelPlantard

RafaelPlantard Oct 23, 2016

Just remembering that right now, the resource count is getted from:
RxSwift.Resources.total.

RafaelPlantard commented Oct 23, 2016

Just remembering that right now, the resource count is getted from:
RxSwift.Resources.total.

@sergdort

This comment has been minimized.

Show comment
Hide comment
@sergdort

sergdort Oct 23, 2016

Collaborator

Hey guys you can also add post install to pod file

post_install do |installer|
   installer.pods_project.targets.each do |target|
      if target.name == 'RxSwift'
         target.build_configurations.each do |config|
            if config.name == 'Debug'
               config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['-D', 'TRACE_RESOURCES']
            end
         end
      end
   end
end
Collaborator

sergdort commented Oct 23, 2016

Hey guys you can also add post install to pod file

post_install do |installer|
   installer.pods_project.targets.each do |target|
      if target.name == 'RxSwift'
         target.build_configurations.each do |config|
            if config.name == 'Debug'
               config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['-D', 'TRACE_RESOURCES']
            end
         end
      end
   end
end

@kzaher kzaher reopened this Oct 23, 2016

@kzaher

This comment has been minimized.

Show comment
Hide comment
@kzaher

kzaher Oct 23, 2016

Member

Let's add this to next release :)

Member

kzaher commented Oct 23, 2016

Let's add this to next release :)

@kzaher

This comment has been minimized.

Show comment
Hide comment
@kzaher

kzaher Nov 20, 2016

Member

Oh,

@sergdort I've thought we can add this to podspec also and not podfile. My bad.

Member

kzaher commented Nov 20, 2016

Oh,

@sergdort I've thought we can add this to podspec also and not podfile. My bad.

@kzaher kzaher closed this Nov 20, 2016

@nahung89

This comment has been minimized.

Show comment
Hide comment
@nahung89

nahung89 May 30, 2017

follow to @kzaher in #1277, i can enable debugging with Carthage by using script:

carthage update --no-use-binaries --configuration Debug RxSwift

nahung89 commented May 30, 2017

follow to @kzaher in #1277, i can enable debugging with Carthage by using script:

carthage update --no-use-binaries --configuration Debug RxSwift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment