-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Remove signing setup from Xamarin iOS task #6853
Conversation
Tasks/XamariniOS/xamarinios.ts
Outdated
//determine the provisioning profile UUID | ||
if (tl.filePathSupplied('provProfile') && tl.exist(provProfilePath)) { | ||
provProfileUUID = await sign.getProvisioningProfileUUID(provProfilePath); | ||
let provProfileUUID: string = tl.getInput('provProfileUuid'); |
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.
I think both of these two variables can be const
now.
@@ -3,6 +3,7 @@ | |||
"loc.helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?LinkID=613729)", | |||
"loc.description": "Build an iOS app with Xamarin on macOS", | |||
"loc.instanceNameFormat": "Build Xamarin.iOS solution $(solution)", | |||
"loc.releaseNotes": "iOS signing setup has been removed from the task. Use `Secure Files` with supporting tasks `Install Apple Certificate` and `Install Apple Provisioning Profile` to setup signing. Updated options to work better with `Visual Studio for Mac`.", |
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.
nit: "set up" as a verb should be two words
Tasks/XamariniOS/xamarinios.ts
Outdated
//determine the provisioning profile UUID | ||
if (tl.filePathSupplied('provProfile') && tl.exist(provProfilePath)) { | ||
provProfileUUID = await sign.getProvisioningProfileUUID(provProfilePath); | ||
let provProfileUUID: string = tl.getInput('provProfileUuid'); |
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.
can be const
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.
And pedantic nit, I think this should match the input name: provProfileUuid
. Acronyms should get cased like normal words so they don't mess up the camel casing
Tasks/XamariniOS/xamarinios.ts
Outdated
@@ -152,7 +101,7 @@ async function run() { | |||
buildRunner.line(args); | |||
} | |||
buildRunner.argIf(codesignKeychain, '/p:CodesignKeychain=' + codesignKeychain); | |||
if (buildTool === 'msbuild' && signIdentity && signIdentity.indexOf(',') > 0) { | |||
if (signIdentity && signIdentity.indexOf(',') > 0) { |
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.
Instead of indexOf
, you can make this signIdentity.includes(',')
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.
Are you sure that's true? IIRC, (and it's very possible I don't RC) we use indexOf
because of TS / JS version compatibility. Do we support the version of Javascript in the tasks project that can use the contains
method?
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.
Sorry this is supposed to be includes
; I've updated my original comment.
String.prototype.includes
was introduced with ES 2015. I tested it on Node 5 and 6 just now and it is supported on both.
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.
👍
"exec": { | ||
"/home/bin/xbuild src/project.sln /p:Configuration=Release /p:Platform=iPhone /t:Clean": { | ||
"code": 0, | ||
"stdout": "msbuild" |
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.
copy-paste error?
Tasks/XamariniOS/xamarinios.ts
Outdated
buildToolPath = path.join(buildToolLocation, 'xbuild'); | ||
} | ||
if (buildTool === 'msbuild' && !buildToolLocation.toLowerCase().endsWith('msbuild')) { | ||
if (buildToolLocation && !buildToolLocation.toLowerCase().endsWith('msbuild')) { |
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.
I can see we want to push the task to use msbuild from the changes to the UI strings and the logic here. But it appears that this is our logic now:
- User supplies
path/to/msbuild/directory/msbuild
and we runpath/to/msbuild/directory/msbuild
- User supplies
path/to/msbuild/directory
and we runpath/to/msbuild/directory/msbuild
(task finds executable) - User supplies
path/to/xbuild/directory/xbuild
and we runpath/to/xbuild/directory/xbuild
- User supplies
path/to/xbuild/directory
and we try to runpath/to/xbuild/directory/msbuild
(and fail) - User does not supply
buildToolLocation
. We find msbuild on the path, else we find xbuild on the path.
Is this correct? It seems odd to me. I think it would make more sense to require the user to provide the full path instead of trying to be smart about whether they provided a directory or file.
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.
As written, it looks like the task will be confused if the msbuild executable lives in a directory named "msbuild." So it sounds like you want to stat
the path to see what it is.
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 new version of the task we don't support "xbuild" for buildToolLocation at all. I think I will remove this and simplify it to look like this: https://github.com/Microsoft/vsts-tasks/blob/master/Tasks/MSBuild/task.json#L78. In Xamarin iOS first there was mdtool, then xbuild and then msbuild. Hopefully we can stick to msbuild now.
Tests-Legacy/L0/XamariniOS/_suite.ts
Outdated
|
||
tr.run() | ||
.then(() => { | ||
assert(tr.invokedToolCount == 0, 'should not have run XamariniOS'); | ||
assert(tr.resultWasSet, 'task should have set a result'); | ||
assert(tr.stderr.length > 0, 'should have written to stderr'); | ||
assert(tr.failed, 'task should have failed'); | ||
assert(tr.stderr.indexOf('not found build tool: /user/bin/xbuild') >= 0, 'wrong error message'); | ||
assert(tr.stderr.indexOf('not found build tool: /user/bin/msbuild') >= 0, 'wrong error message'); |
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.
Can use contains
. And since tr.stderr
is a string, we might as well print out what the actual stderr
was in the diagnostic message.
@@ -170,27 +119,7 @@ async function run() { | |||
|
|||
} catch (err) { | |||
tl.setResult(tl.TaskResult.Failed, tl.loc('XamariniOSFailed', err)); | |||
} finally { | |||
//clean up the temporary keychain, so it is not used to search for code signing identity in future builds | |||
if (codesignKeychain) { |
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.
I think this variable can be removed now.
Tasks/XamariniOS/xamarinios.ts
Outdated
@@ -152,7 +101,7 @@ async function run() { | |||
buildRunner.line(args); | |||
} | |||
buildRunner.argIf(codesignKeychain, '/p:CodesignKeychain=' + codesignKeychain); |
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.
I think this line isn't used anymore.
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.
Good point, we decided not to expose this in the task inputs for the Xcode task as well. I will remove it.
} | ||
|
||
//delete provisioning profile if specified | ||
if (profileToDelete) { |
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.
I think this variable can be removed.
No description provided.