Atom link to xar file is incorrect #338

Closed
odrobnik opened this Issue Mar 13, 2013 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

odrobnik commented Mar 13, 2013

When generating a docset and atom feed I have these settings:

<key>--docset-feed-url</key>
<string>https://docs.cocoanetics.com/DTCoreText/%DOCSETATOMFILENAME</string>

and

<key>--docset-package-url</key>
<string>https://docs.cocoanetics.com/DTCoreText/%DOCSETPACKAGEFILENAME</string>

This leads to these values shown with --print-settings:

 --docset-fallback-url = https://docs.cocoanetics.com/DTCoreText/
 --docset-publisher-id = com.cocoanetics.documentation
 --docset-publisher-name = Cocoanetics
 --docset-min-xcode-version = 3.0
 --docset-platform-family = 
 --docset-cert-issuer = 
 --docset-cert-signer = 
 --docset-bundle-filename = com.cocoanetics.DTCoreText.docset
 --docset-atom-filename = DTCoreText.atom
 --docset-xml-filename = com.cocoanetics.DTCoreText.xml
 --docset-package-filename = com.cocoanetics.DTCoreText-1.2

In the publish folder the resulting xar file is named com.cocoanetics.DTCoreText-1.xar which in no way matches any of the above settings. Either it is always appending the -1 or it's missing the rest of the version number after the first period.

The generated Atom file looks like this, notice the enclosure URL:

<?xml version="1.0" standalone="no"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:docset="http://developer.apple.com/rss/docset_extensions" xml:lang="en">
    <id>https://docs.cocoanetics.com/DTCoreText/DTCoreText.atom/20130313125051</id>
    <title type="text">DTCoreText Documentation</title>
    <rights>Copyright © 2013 Cocoanetics. All rights reserved.</rights>
    <link rel="self" href="https://docs.cocoanetics.com/DTCoreText/DTCoreText.atom"></link>
    <docset:publisherName>Cocoanetics</docset:publisherName>
    <docset:publisherID>com.cocoanetics.documentation</docset:publisherID>
    <updated>2013-03-13T12:50:51+01:00</updated>
    <entry>
        <id>tag:docs.cocoanetics.com,2013-03-13:com.cocoanetics.DTCoreText/1.2.0</id>
        <title type="text">DTCoreText Documentation</title>
        <updated>2013-03-13T12:50:51+01:00</updated>
        <content type="text">DTCoreText Documentation (v1.2.0)</content>
        <link rel="enclosure" type="application/octet-stream" href="https://docs.cocoanetics.com/DTCoreText/com.cocoanetics.DTCoreText-1.2" length="602248"></link>
        <docset:identifier>com.cocoanetics.DTCoreText</docset:identifier>
        <docset:version>1.2.0</docset:version>
        <docset:minimumXcodeVersion>3.0.0</docset:minimumXcodeVersion>
    </entry>
</feed>

The enclosure URL seems to be identical to the --docset-feed-url where it seems that there is no extension added.

So my question/issue is, how can I get the resulting created xar file name to match the docset atom enclosure URL?

odrobnik added a commit to odrobnik/appledoc that referenced this issue Mar 13, 2013

Removed superfluous removing of extension.
This causes problems since there is not supposed to be an extension anyway. Removing an extension from DTCoreText-1.2 causes the package name to be become DTCoreText-1.xar which is wrong.

Fixes #338

odrobnik added a commit to odrobnik/appledoc that referenced this issue Mar 13, 2013

Add the .xar extension to the enclosure URL if necessary
Fixes #338

The extension xar is added to the output file path for the docset utility, but it is not checked that it is in the url. Without this there is a scenario where the URL is missing the extension.

odrobnik added a commit to odrobnik/appledoc that referenced this issue Mar 13, 2013

Add the .xar extension to the enclosure URL if necessary
Fixes #338

The extension xar is added to the output file path for the docset utility, but it is not checked that it is in the url. Without this there is a scenario where the URL is missing the extension.
Contributor

odrobnik commented Mar 13, 2013

Turns out that there were actually two overlapping bugs:

the package file name is not supposed to have an extension, but still there was a deleting of extension happening which shortened the name from DTCoreText-1.2 to DTCoreText-1 - I removed this superfluous extension removal.

The second problem was that when the atom output type is chosen the output file name gets the .xar appended, but the the docset package URL for the atom feed does not. So I am appending this if the url doesn't have a .xar extension already.

Owner

tomaz commented Mar 13, 2013

Cool, thanks - is it ready for merge or are you still working on it?

Contributor

odrobnik commented Mar 13, 2013

You can merge it, I already have it in production. :-)

@tomaz tomaz closed this in 09ebc6a Mar 13, 2013

Owner

tomaz commented Jun 5, 2013

Replied to your issue on GitHub.

Sent from my iPad

On Wed, Jun 5, 2013 at 3:35 AM, Jeff Tanner notifications@github.com
wrote:

Hi I am getting a similar issue, but within the media files link via Mozilla Firefox
Copying the URL within the link: https://api.mobileapptracking.com/MobileAppTracker.xar
Instead, I am getting: https://api.mobileapptracking.com/api.mobileapptracking.com/MobileAppTracker.xar
And this is the actually from view source:

<?xml version="1.0" standalone="no"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:docset="http://developer.apple.com/rss/docset_extensions" xml:lang="en">
    <id>https://api.mobileapptracking.com/sdk_ios.atom/20130529163755</id>
    <title type="text">MobileAppTracker.framework Documentation</title>
  <subtitle><![CDATA[Allowing Xcode iOS users subscribe to MobileAppTracker.framework documentation.]]></subtitle>
    <rights>Copyright © 2013 HasOffers Inc.. All rights reserved.</rights>
    <link rel="self" href="https://api.mobileapptracking.com/MobileAppTracker/sdk_ios.atom"></link>
    <docset:publisherName>HasOffers Inc.</docset:publisherName>
    <docset:publisherID>com.hasoffers.documentation</docset:publisherID>
    <updated>2013-05-29T16:37:55Z</updated>   <author>
      <name><![CDATA[MAT Support | support@mobileapptracking.com]]></name>
  </author>
  <logo><![CDATA[http://api.mobileapptracking.com/img/logo.png]]></logo>
    <entry>
        <id>tag:api.mobileapptracking.com,2013-05-29:com.hasoffers.MobileAppTracker.framework/MAT iOS SDK v2.3</id>
        <title type="text">MobileAppTracker.framework Documentation</title>
        <updated>2013-05-29T16:37:55Z</updated>
        <content type="text">MobileAppTracker.framework Documentation/MAT iOS SDK v2.3</content>
        <link rel="enclosure" type="application/octet-stream" href="https:/api.mobileapptracking.com/MobileAppTracker.xar" length="68364"></link> 
      <author>
          <name><![CDATA[MAT Support | support@mobileapptracking.com]]></name>
      </author>
        <docset:identifier>com.hasoffers.MobileAppTracker.framework</docset:identifier>
        <docset:version>2.3.0</docset:version>
        <docset:minimumXcodeVersion>3.0.0</docset:minimumXcodeVersion>
    </entry>
</feed>

Ideas?

Jeff

Reply to this email directly or view it on GitHub:
#338 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment