MPXJ is it possible to set % Complete of task? [version 5.1.10.0] - mpxj

I try to set 50 % Complete for single task using MPXJ in C# code
var pfTask = pf.GetTaskByID(new java.lang.Integer(task.ID));
pfTask.PercentageComplete = new java.lang.Integer(task.PercentComplete);
but it doesn't work - after opening in MS Project 2010/2013 50% is set but for [% work Complete] not for [% Complete].

Try using the latest mpxj library. 5.2.2
Check these APIs of Task class
1. setPercentageComplete
2. setPercentageWorkComplete

Related

Karate - Cucumber reports - How can I get cucumber to generate a unique .html report file each time I run a build [duplicate]

I have recently upgraded to version 1.0.0 from 0.9.6 and noticed that the generated karate-summary.html file, it doesn't display all the tested feature files in the JUnit 5 Runner unlike in 0.9.6.
What it displays instead was the last tested feature file only.
The below screenshots are from the provided SampleTest.java sample code (excluding other Tests for simplicity).
package karate;
import com.intuit.karate.junit5.Karate;
class SampleTest {
#Karate.Test
Karate testSample() {
return Karate.run("sample").relativeTo(getClass());
}
#Karate.Test
Karate testTags() {
return Karate.run("tags").relativeTo(getClass());
}
}
This is from Version 0.9.6.
And this one is from Version 1.0.0
However, when running the test below in 1.0.0, all the features are displayed in the summary correctly.
#Karate.Test
Karate testAll() {
return Karate.run().relativeTo(getClass());
}
Would anyone be kind to confirm if they are getting the similar result? It would be very much appreciated.
What it displays instead was the last tested feature file only.
This is because for each time you run a JUnit method, the reports directory is backed up by default. Look for other directories called target/karate-reports-<timestamp> and you may find your reports there. So maybe what is happening is that you have multiple JUnit tests that are all running, so you see this behavior. You may be able to over-ride this behavior by calling the method: .backupReportDir(false) on the builder. But I think it may not still work - because the JUnit runner has changed a little bit. It is designed to run one method at a time, when you are in local / dev-mode.
So the JUnit runner is just a convenience. You should use the Runner class / builder for CI execution, and when you want to run multiple tests and see them in one report: https://stackoverflow.com/a/65578167/143475
Here is an example: ExamplesTest.java
But in case there is a bug in the JUnit runner (which is quite possible) please follow the process and help the project developers replicate and then fix the issue to release as soon as possible.

NPM with NuGet package auto versioning

Our Goal is to have Auto versioning for npm and NuGet packages in release definition of Azure Pipelines
As of now we are using the tokenization task based on the rev value we replacing the version numbers in both nuspec and package.json files.
So we getting the version numbers like 1.0.1, 1.0.2….. like this and auto versioning achieved in release definition
But the problem is whenever the release fails we are losing those numbers as our version numbers because rev value is increasing
Example: If my published version of artifacts is 1.0.1..
Next version to be published for me is 1.0.2
But if the 1.0.2 release is failed and if 1.0.3 is succeeded we are getting published number as 1.0.3 here for end user 1.0.2 is missing
Now we need the help to increment my version number based on last successful release or to reset the rev value based on the successful release or to get the published version of artifacts and increase that number
Or any other best practices to accomplish this task will be helpful.
Thank you in advance.
NPM with NuGet package auto versioning
I am afraid there is no such way to accomplish this task directly. Because $(Rev:.r) is the build number on this day. Use $(Rev:.r) to ensure that every completed build has a unique name. When a build is completed, if nothing else in the build number has changed, the Rev integer value is incremented by one. This value stores in database.
As test, I have created a Inline Powershell task to modify the value when build/release task fails.
I use the powershell script Write-Host "##vso[build.updatebuildnumber]$newVersionNumber" to update the build.updatebuildnumber (I use build.updatebuildnumber as nuget package version.) and set the option Run this task as Only when a previous task has failed:
To see which variables you can use for build and release pipelines, check these pages: - Build variables - Release variables.
Following is the powershell scripts to modify the build.updatebuildnumber:
$vstsCurrentVersionNumber = $Env:BUILD_BUILDNUMBER
$currentVersionNumber = $vstsCurrentVersionNumber.Split(".")
$revisionNumber = $currentVersionNumber[3]
$newRevisionNumber = [int]$revisionNumber -1
$newVersionNumber = $currentVersionNumber[0] + "." +
$currentVersionNumber[1] + "." + $currentVersionNumber[2] + "." +
$newRevisionNumber
$env:VersionNumber = $newVersionNumber
Write-Host "Update Build Number To: $newVersionNumber"
Write-Host "##vso[build.updatebuildnumber]$newVersionNumber"
Indeed, if the build/release task failed, the build number will be modified at this building.
However, when we execute the build/release next time, the buildnumber/$(Rev:.r) still increase based on the last failed build result:
As workaround, we could set a value for the nuget package version, like 1.0.0. And add a Inline Powershell task to increase the value of the version by one each time, when we successfully build/release. Do not execute Inline Powershell task when the build/release fails.
Hope this helps.

Clone a entire Document/Excel/Presentation on specific Version

Is There any Options to Clone a Word / Excel / Presentation Based on document version number
for Ex:
version - 4
version - 3
version - 2
version - 1
Here I need to clone Version 4 In Onlyoffice Document Integration Server
and without any mismatch of editor contents
here I uploaded the image in that 7 version are there, I need to clone a 4'th version (which means version 4,3,2,1 and I don't want 5,6,7) it's not like rollback, original document should not get change while cloning.
Please describe the case more detailed, we need more information about the whole process, i.e. are you going to just copy the file or start a new conversion process?
Could you please specify if the versioning already works in your environment.
If yes, how is it organized.

xlwings' RunPython fails on MAC

MAC 10.12.5
Excel 2011 for MAC
xlwings.__version__ '0.11.2'
xlwings.__path__
['/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xlwings']
Trying to do a RunPython from excel, always fails with:
Compile Error
Connot find file or library
Trying to narrow down, running the VBA code found in
Function GetConfigFilePath() As String), specifically:
> mymodule = Left(ThisWorkbook.Name, (InStrRev(ThisWorkbook.Name, ".", -1, vbTextCompare) - 1))
invariably gives me a:
Compile Error
Connot find file or library
I see that the
~/Library/Containers/com.microsoft.Excel/Data/xlwings.conf
could not be found but i have no idea how to get it there, any lead please ?
UPDATE: v0.11.4 supports Mac Excel 2011 again, see: http://docs.xlwings.org/en/stable/whatsnew.html#v0-11-4-jul-23-2017
Make sure to check that it references the correct xlwings addin: In the VBA editor, go to Tools > References and select xlwings. Unselect those that start with MISSSING.... Make sure the correct project is selected while you do this.
original answer:
Mac Excel 2011 support hasn't quite caught up with the new add-in. The issues is that Excel 2011 doesn't show the ribbon and so the config file will not be created automatically. We will work on improving the user experience, but for now you should be able to work around it like this:
Create an empty xlwings.conf in the following path (you'll need to create it if you don't have Excel 2016 installed) ~/Library/Containers/com.microsoft.Excel/Data
Edit it following the instructions, if you want to set global settings that deviate from the defaults: http://docs.xlwings.org/en/stable/addin.html#config-file
Alternatively, skip the 2 steps above and include a xlwings.conf sheet as created automatically by xlwings quickstart <projectname>, see: http://docs.xlwings.org/en/stable/addin.html#workbook-settings (you need to use the addin from >= 0.11.3 though as there was a bug in the earlier versions.

CruiseControl.Net - Can the labeller be made to run after MSBuild?

I have created a custom labeller for CC.Net which is working almost perfectly, however it appears that the labeller runs before the application is built. The issue I have with this is that I want my build label to be that of my AssemblyVersion.
I have the following in my labeller:
public string Generate(IIntegrationResult previousResult)
{
if (File.Exists(this.OutputExecutable))
{
Assembly assembly = System.Reflection.Assembly.Load(System.IO.File.ReadAllBytes(this.OutputExecutable));
string version = assembly.GetName().Version.ToString();
assembly = null;
return version;
}
else
{
return "0.0.0.0";
}
}
This gets the version of the provided DLL/Exe so that I can use it as my build label. I'll probably go on to add the actual build number in later, but I just want to get this bit working first.
The issue is that my Revision number is in the format 2.0.93601.254 major.minor.date.svnrevision. When a check-in occurs, I build the codebase and the revision number would go to 2.0.93601.255. Unfortunately CC.Net still produces a Build Label of .254 until a force build is called when it will be successfully changed to .255.
Is there any way I can force the labeller to wait until the build process is complete? Or are there any alternative ways I should be doing this?
The answer to this I believe is no. What I did was to create my own console application that updates the assemblyinfo.cs file before the MSBuild task in CC.Net's project configuration. Problem (kind of) solved.
This is backwards from how most people do this; you make ccnet set the version of your code & assemblies automatically, pulling the version from config and say the svn rev #.
This is why it is critically important the labeller runs before tasks.

Resources