LLBLGEN + TFS

Posts   
 
    
MichelZ avatar
MichelZ
User
Posts: 24
Joined: 25-Jul-2008
# Posted on: 05-May-2016 11:41:56   

Refering to this thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=8962

Is this something that can be fixed? The behavior is as described: Once code is generated, the new code files get added to the project fine, but they are not under source control. A manual "Add to Source Control" has to be executed for them to get added to TFS. This is pretty annoying...

Using TFS 2015 U2, VS 2015 U2, LLBLGEN 5 RTM

Thanks Michel

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 05-May-2016 12:24:32   

As TFS still reports the same issue as back in the time of that thread, there's little we can do: we update the files in the vs.net proj, I don't know what else we can do here. THe macro in that thread can help but I don't know what else there is to do to tell TFS to do what it should...

Frans Bouma | Lead developer LLBLGen Pro
MichelZ avatar
MichelZ
User
Posts: 24
Joined: 25-Jul-2008
# Posted on: 05-May-2016 14:21:55   

Would you be willing to go through Microsoft support for this?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 05-May-2016 17:09:29   

MichelZ wrote:

Would you be willing to go through Microsoft support for this?

I've no idea what to tell them, as we don't use TFS nor did I ever use it. What I do know is that unless it now works, it's still the same problem, and as it's a behavior aspect of TFS I don't know whether it's a bug or a feature which gets in the way. I.e. if it's a bug they might fix it, but if it's not a bug they won't fix it.

If you want to go through their support to get this changed, we're willing to help, as in: if they want more info regarding inner workings of our system we'll provide that.

Frans Bouma | Lead developer LLBLGen Pro
jovball
User
Posts: 435
Joined: 23-Jan-2005
# Posted on: 06-Jun-2016 22:34:35   

Michel:

I don't think this is a bug, it's just the way TFS works. We are using TFS (although looking hard at switching to Git). We use a Powershell script to execute the TF command line to find and pend (add) the files, and open the GUI check-in dialog.

I've also attached the script as a text file.


<#
Use TF to add files to TFS.
This type of script is helpful when using code generators that add files outside of Visual Studio.
This script makes some assumptions about script/folder locations but can be easily modified.

The folder structure assumed for this script is:

Parent Folder
    This Powershell script
    The LLBLGen Project file
    GeneratedCode
        DatabaseGeneric Project Folder
            EntityClasses
            EntityCustomization
            FactoryClasses
            ...
        DatabaseSpecific Project Folder
            ActionProcedures
            DataAccessAdapter
            ...
#>
$scriptPath = Split-Path ((Get-Variable MyInvocation -Scope 0).Value).MyCommand.Path
$solutionFolder = (Split-Path $scriptPath)
$projectFolder = $scriptPath
$projectFile = Join-Path $projectFolder "YourProjectFileName.llblgenproj"
#change this to match your version of TF
$tfExePath = "${env:ProgramFiles(X86)}\Microsoft Visual Studio 12.0\Common7\IDE\TF.exe"

# cd to the directory containing your project.
Push-Location $projectFolder
Write-Host "Working directory:" $projectFolder

Write-Host "Pend new files"
[Array]$arguments = "folderdiff", $projectFolder, "/recursive", "/view:targetOnly"
#change the regex pattern to match your folder structure
& $tfExePath $arguments | sls -Pattern ".*Database.*(\.vb$|\.cs$)" | % {
    if($_ -notmatch ".*(\\bin\\|\\obj\\).*") #ignore anything in bin or obj folders
    {
        Write-Host "Add New file: $_"
        & $tfExePath add "$_"
    }
}

Write-Host "Check in for the specified folders"
#this will open the TFS GUI check-in dialog
[Array]$arguments = "checkin", "/recursive", "YourGeneratedCodeFolderName", $projectFile
& $tfExePath $arguments

Attachments
Filename File size Added on Approval
TFS-Pend.txt 1,763 06-Jun-2016 22:39.54 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-Jun-2016 08:59:30   

Thanks for sharing, Joel!

Frans Bouma | Lead developer LLBLGen Pro
jovball
User
Posts: 435
Joined: 23-Jan-2005
# Posted on: 07-Jun-2016 12:40:47   

I'm happy to be on this end for a change! Usually I'm the one in here looking for answers. smile

MichelZ avatar
MichelZ
User
Posts: 24
Joined: 25-Jul-2008
# Posted on: 09-Jun-2016 07:50:14   

Thanks, will try this!