@@ -16,10 +16,10 @@ Begin Form
16
16
Width =9360
17
17
DatasheetFontHeight =11
18
18
ItemSuffix =33
19
- Left =3225
20
- Top =2430
21
- Right =18945
22
- Bottom =14175
19
+ Left =20761
20
+ Top =2250
21
+ Right =-29055
22
+ Bottom =13995
23
23
OnUnload ="[Event Procedure]"
24
24
RecSrcDt = Begin
25
25
0 x79e78b777268e540
@@ -1749,6 +1749,9 @@ Public objSingleObject As AccessObject
1749
1749
' (The Log object has already been reset at this point, so we can't use Log.LogFilePath.)
1750
1750
Public strLastLogFilePath As String
1751
1751
1752
+ ' Use this property to set the path to the source files (such as a build triggered from the API)
1753
+ Public strSourcePath As String
1754
+
1752
1755
1753
1756
'---------------------------------------------------------------------------------------
1754
1757
' Procedure : cmdBuild_Click
@@ -1760,11 +1763,6 @@ Public strLastLogFilePath As String
1760
1763
Public Sub cmdBuild_Click ()
1761
1764
1762
1765
Dim strFolder As String
1763
- Dim strMsg(0 To 2 ) As String
1764
- Dim intChoice As VbMsgBoxResult
1765
-
1766
- DoCmd.Hourglass True
1767
- DoEvents
1768
1766
1769
1767
' Make sure we use the add-in to build the add-in.
1770
1768
If CodeProject.FullName = CurrentProject.FullName Then
@@ -1774,6 +1772,43 @@ Public Sub cmdBuild_Click()
1774
1772
Exit Sub
1775
1773
End If
1776
1774
1775
+ ' Get source files folder
1776
+ If Len(Me.strSourcePath) Then
1777
+ ' Use specified build folder
1778
+ strFolder = Me.strSourcePath
1779
+ Else
1780
+ ' Attempt to get the source folder from the current database, or from
1781
+ ' a folder picker dialog.
1782
+ strFolder = GetSourceFolder
1783
+ ' Exit out of build if the user cancelled any of the confirmations.
1784
+ If strFolder = vbNullString Then Exit Sub
1785
+ End If
1786
+
1787
+ ' Build project using the selected source folder
1788
+ ' (Use a timer so we can release the reference to this form before beginning the
1789
+ ' build process, just in case we need to import a form with the same name.)
1790
+ If strFolder <> vbNullString Then SetTimer "Build" , strFolder, chkFullBuild
1791
+
1792
+ End Sub
1793
+
1794
+
1795
+ '---------------------------------------------------------------------------------------
1796
+ ' Procedure : GetSourceFolder
1797
+ ' Author : Adam Waller
1798
+ ' Date : 10/19/2023
1799
+ ' Purpose : Return the source files folder from either the currently open database
1800
+ ' : or from a folder picker dialog. (Returns an empty string if the user
1801
+ ' : cancels the selection.)
1802
+ '---------------------------------------------------------------------------------------
1803
+ '
1804
+ Private Function GetSourceFolder () As String
1805
+
1806
+ Dim strMsg(0 To 2 ) As String
1807
+ Dim intChoice As VbMsgBoxResult
1808
+
1809
+ DoCmd.Hourglass True
1810
+ DoEvents
1811
+
1777
1812
' Close the current database if it is currently open.
1778
1813
If DatabaseFileOpen Then
1779
1814
If FolderHasVcsOptionsFile(Options.GetExportFolder) Then
@@ -1795,18 +1830,18 @@ Public Sub cmdBuild_Click()
1795
1830
End If
1796
1831
If intChoice = vbYes Then
1797
1832
' Rebuild the open project
1798
- strFolder = Options.GetExportFolder
1833
+ GetSourceFolder = Options.GetExportFolder
1799
1834
ElseIf intChoice = vbCancel Then
1800
1835
' Canceled out of build option.
1801
1836
DoCmd.Hourglass False
1802
- Exit Sub
1837
+ Exit Function
1803
1838
End If
1804
1839
End If
1805
1840
End If
1806
1841
1807
1842
' If we aren't doing the current database, then prompt user to find a folder
1808
1843
' with source files to use for the build.
1809
- If strFolder = vbNullString Then
1844
+ If GetSourceFolder = vbNullString Then
1810
1845
1811
1846
' Show a folder picker to select the file with source code.
1812
1847
DoCmd.Hourglass False
@@ -1820,26 +1855,21 @@ Public Sub cmdBuild_Click()
1820
1855
' Selected a folder
1821
1856
If FolderHasVcsOptionsFile(.SelectedItems(1 )) Then
1822
1857
' Has source files
1823
- strFolder = .SelectedItems(1 ) & PathSep
1858
+ GetSourceFolder = .SelectedItems(1 ) & PathSep
1824
1859
DoCmd.Hourglass True
1825
1860
Else
1826
1861
MsgBox2 "Source files not found" , "Required source files were not found in this folder." , _
1827
1862
"You selected: " & .SelectedItems(1 ), vbExclamation
1828
- Exit Sub
1863
+ Exit Function
1829
1864
End If
1830
1865
Else
1831
1866
' Canceled dialog
1832
- Exit Sub
1867
+ Exit Function
1833
1868
End If
1834
1869
End With
1835
1870
End If
1836
1871
1837
- ' Build project using the selected source folder
1838
- ' (Use a timer so we can release the reference to this form before beginning the
1839
- ' build process, just in case we need to import a form with the same name.)
1840
- If strFolder <> vbNullString Then SetTimer "Build" , strFolder, chkFullBuild
1841
-
1842
- End Sub
1872
+ End Function
1843
1873
1844
1874
1845
1875
'---------------------------------------------------------------------------------------
0 commit comments