Skip to content
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

Fix Unity version parameter compilation errors #206

Merged

Conversation

bdovaz
Copy link
Collaborator

@bdovaz bdovaz commented Jul 15, 2022

No description provided.

@FejZa FejZa merged commit 56c4da7 into Dinomite-Studios:main Jul 15, 2022
@bdovaz bdovaz deleted the feature/fix-unity-version-parameter branch July 15, 2022 20:37
@bdovaz
Copy link
Collaborator Author

bdovaz commented Jul 16, 2022

@FejZa I have realized that when I have corrected the compilation error I have actually generated another problem.

Before when I didn't know that "getUnityEditorVersion()" returned an object of type "UnityVersionInfoResult" instead of a string (what I thought) it was going to evaluate right because if getInput() is null, it evaluates the one on the right.

But when I realized that I had to return an object of type "UnityVersionInfoResult" now I always return an instance of it so it will always evaluate the left hand side as non-null but with the version property to null if getInput() is null.

That problem needs to be fixed, will you take care of it or shall I help you?

https://github.com/Dinomite-Studios/unity-azure-pipelines-tasks/pull/206/files#diff-8bb3905afc0c9f7674a34175cd57333ea9f52749a21dd1d8978b2263a3a133f4R33

@derekfreed
Copy link
Contributor

derekfreed commented May 8, 2024

@FejZa I have realized that when I have corrected the compilation error I have actually generated another problem.

Before when I didn't know that "getUnityEditorVersion()" returned an object of type "UnityVersionInfoResult" instead of a string (what I thought) it was going to evaluate right because if getInput() is null, it evaluates the one on the right.

But when I realized that I had to return an object of type "UnityVersionInfoResult" now I always return an instance of it so it will always evaluate the left hand side as non-null but with the version property to null if getInput() is null.

That problem needs to be fixed, will you take care of it or shall I help you?

https://github.com/Dinomite-Studios/unity-azure-pipelines-tasks/pull/206/files#diff-8bb3905afc0c9f7674a34175cd57333ea9f52749a21dd1d8978b2263a3a133f4R33

@bdovaz / @FejZa
I have a suspicion that this issue over here may be related to this new problem you outlined.

It seems that my unitytest task won't work unless I explicitly specify the unityversion which was not the old behavior since it would correctly get the unity version if I did not specify it.

I know this was a while ago, but do you have a fix for this?

I'm thinking we could do something like the following to make sure the unityversion is evaluated properly:

const unityVersionInput = tl.getInput(unityVersionInputVariableName);
const unityVersion = unityVersionInput ? { info: { version: unityVersionInput } } as UnityVersionInfoResult : getUnityEditorVersion();

@derekfreed
Copy link
Contributor

I just opened a PR which hopes to resolve this #257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants