Skip to content

Commit

Permalink
moving templates to tmpl directory structure
Browse files Browse the repository at this point in the history
minor update to DEVELOPING.md
  • Loading branch information
emawby committed May 19, 2021
1 parent f3cd654 commit f631534
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ projectname. For example, `spec/samples/googleandroid/kotlin/bottomnav`.

The primary tests are located in `spec/osproject_spec.rb`, which contains the autoloading platform test. Additional SDK sample tests are defined in this file.

Using RSpec, you can run test cases using `RSpec spec/osproject_spec.rb`. Note that the require paths are resolved according to the dir you're in when you're executing the code so running `RSpec spec/osproject_spec.rb` from inside the spec folder will not work.
Using RSpec, you can run test cases using `bin/rspec spec/osproject_spec.rb`. Note that the require paths are resolved according to the dir you're in when you're executing the code so running `bin/rspec spec/osproject_spec.rb` from inside the spec folder will not work.

## CLI
CLI Behavior and business logic tests are located in `spec/oscli.rb`.
Expand Down
11 changes: 8 additions & 3 deletions lib/osproject_ios.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ class OSProject::IOS < OSProject

attr_accessor :target_name

SWIFT_NSE_PATH = 'tmpl/iOS/swift/NotificationService.swift'
OBJC_NSE_H_PATH = 'tmpl/iOS/objc/NotificationService.h'
OBJC_NSE_M_PATH = 'tmpl/iOS/objc/NotificationService.m'
NSE_INFO_PLIST_PATH = 'tmpl/iOS/Info.plist'

def initialize(dir, lang, os_app_id)
@has_sdk = false
super("ios", dir, lang, os_app_id)
Expand Down Expand Up @@ -63,16 +68,16 @@ def _create_nse()
end

if lang == :swift
FileUtils.cp_r('lib/NotificationService.swift', nsePath)
FileUtils.cp_r(SWIFT_NSE_PATH, nsePath)
assets = self.nse_group.new_reference("OneSignalNotificationServiceExtension/NotificationService.swift")
else
FileUtils.cp_r %w(lib/NotificationService.h lib/NotificationService.m), nsePath
FileUtils.cp_r [OBJC_NSE_H_PATH, OBJC_NSE_M_PATH], nsePath
self.nse_group.new_reference("OneSignalNotificationServiceExtension/NotificationService.h")
assets = self.nse_group.new_reference("OneSignalNotificationServiceExtension/NotificationService.m")
end

# copy the Info.plist file into the NSE group
FileUtils.cp_r('lib/Info.plist', nsePath)
FileUtils.cp_r(NSE_INFO_PLIST_PATH, nsePath)
plist_reference = self.nse_group.new_reference("OneSignalNotificationServiceExtension/Info.plist")

# Create NSE target
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f631534

Please sign in to comment.