-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Support CocoaPods #70
Conversation
Thanks, very much!
How should I treat this TODO? Do you demand me to merge to master to deal with them? In advance, I noticed a review point, so I'll comment now. |
Makefile
Outdated
mkdir "$(TEMPORARY_FOLDER)" | ||
cp -f ".build/release/LicensePlist" "$(TEMPORARY_FOLDER)" | ||
cp -f "LICENSE" "$(TEMPORARY_FOLDER)" | ||
(cd tmp/portable_licenseplist; zip -r - LICENSE LicensePlist) > './portable_licenseplist.zip' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is tmp/portable_licenseplist
correct?
It seems to be that $(TEMPORARY_FOLDER)
(tmp_portable_licenseplist
) is correct for me.
clean: | ||
swift package clean | ||
|
||
xcode: | ||
swift package generate-xcodeproj | ||
|
||
|
||
install: build | ||
mkdir -p "$(PREFIX)/bin" | ||
cp -f ".build/release/LicensePlist" "$(PREFIX)/bin/license-plist" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The executable binary is renamed to chain case from camel case here when installed via Makefile or Homebrew.
It is better to also apply it cp -f ".build/release/LicensePlist" "$(TEMPORARY_FOLDER)"
, isn't it?
(I don't understand CocoaPods distribution well.)
Makefile
Outdated
|
||
portable_zip: build | ||
mkdir "$(TEMPORARY_FOLDER)" | ||
cp -f ".build/release/LicensePlist" "$(TEMPORARY_FOLDER)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be cp -f ".build/release/LicensePlist" "$(TEMPORARY_FOLDER)/license-plist"
?
README.md
Outdated
```sh | ||
if [ $CONFIGURATION = "Debug" ]; then | ||
cd $SRCROOT | ||
${PODS_ROOT}/LicensePlist/portable_licenseplist --output-path $PRODUCT_NAME/Settings.bundle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of SwiftLint CocoaPods distribution, its executable binary is located at Pods/SwiftLint/swiftlint
.
So, I think ${PODS_ROOT}/LicensePlist/license-plist --output-path $PRODUCT_NAME/Settings.bundle
is more natural.
(Of course, it is necessary to modify other scripts to fit this command if needed.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. I rename binary name to license-plist
, also modify others.
LicensePlist.podspec.tmp
Outdated
s.license = { :type => 'MIT', :file => 'LICENSE' } | ||
s.author = 'Masayuki Ono' | ||
s.source = { :http => '#{s.homepage}/releases/download/#{s.version}/portable_licenseplist.zip' } | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do this file name contain .tmp
?
I think you can test CocoaPods installation with this command by removing .tmp
.
pod 'LicensePlist', :git => 'https://github.com/simorgh3196/LicensePlist.git', :branch => 'cocoapods'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s.source = { :http => '#{s.homepage}/releases/download/#{s.version}/portable_licenseplist.zip' }
I noticed that, it is required to modify this for testing temporarily.
If it is difficult to test in advance, I'll merge it after the review requests is processed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to deliver CocoaPods updates in release.sh, I wanted to be able to set the version number externally.
Therefore, I thought that create a new podspec dynamicary, and replace version number.
LicensePlist.podspec.tmp
s.version = 'LATEST_RELEASE_VERSION_NUMBER'
release.sh
cat "$podspec_name.tmp" | sed s/LATEST_RELEASE_VERSION_NUMBER/$tag/ > "$podspec_name"
If you have any other good ideas please let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I understand. It seems to be good 👍
(SwiftLint use another technique though.)
LicensePlist.podspec.tmp
Outdated
s.license = { :type => 'MIT', :file => 'LICENSE' } | ||
s.author = 'Masayuki Ono' | ||
s.source = { :http => '#{s.homepage}/releases/download/#{s.version}/portable_licenseplist.zip' } | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I understand. It seems to be good 👍
(SwiftLint use another technique though.)
- After confirmed that CocoaPods distribution works fine, I'll re-revert this. This error occurred: ```sh ==> make install PREFIX=/usr/local/Cellar/license-plist/1.6.0 🍺 /usr/local/Cellar/license-plist/1.6.0: 5 files, 9.3MB, built in 50 seconds adding: license-plist (deflated 72%) swift build -c release -Xswiftc -static-stdlib mkdir -p "./tmp_portable_licenseplist" cp -f ".build/release/LicensePlist" "./tmp_portable_licenseplist/license-plist" cp -f "LICENSE" "./tmp_portable_licenseplist" (cd ./tmp_portable_licenseplist; zip -r - LICENSE license-plist) > "./portable_licenseplist.zip" adding: LICENSE (deflated 41%) adding: license-plist (deflated 72%) rm -r "./tmp_portable_licenseplist" cat: LicencePlist.podspec.tmp: No such file or directory [!] You need to register a session first. ```
Thank you for the PR. I noticed that you tested the installation: https://github.com/simorgh3196/LicensePlist/tree/cocoapods-test 👍 After I merged this to master, I executed If you could resolve this error, submit a new PR. |
Issue: #52
I hope I can install this library with CocoaPods.
I tried installing with CocoaPods by referring to
SwiftLint
etc.I did not actually register with CocoaPods, so I can not confirm whether it will work, but I tried making a PR wishing this would be useful.
I would be happy if you can provide feedback if there are still missing operations.
TODO