(
result: Extract<ToolDomainResult, { kind: 'build-result' }>,
)
| 1960 | } |
| 1961 | |
| 1962 | function createCleanResultItems( |
| 1963 | result: Extract<ToolDomainResult, { kind: 'build-result' }>, |
| 1964 | ): TextRenderableItem[] { |
| 1965 | const isSwiftPackage = |
| 1966 | 'artifacts' in result && !!result.artifacts && 'packagePath' in result.artifacts; |
| 1967 | const title = isSwiftPackage ? 'Swift Package Clean' : 'Clean'; |
| 1968 | const params: HeaderRenderItem['params'] = []; |
| 1969 | |
| 1970 | if ('artifacts' in result && result.artifacts) { |
| 1971 | if ('packagePath' in result.artifacts && typeof result.artifacts.packagePath === 'string') { |
| 1972 | params.push({ label: 'Package', value: result.artifacts.packagePath }); |
| 1973 | } else { |
| 1974 | if ('scheme' in result.artifacts && typeof result.artifacts.scheme === 'string') { |
| 1975 | params.push({ label: 'Scheme', value: result.artifacts.scheme }); |
| 1976 | } |
| 1977 | if ( |
| 1978 | 'workspacePath' in result.artifacts && |
| 1979 | typeof result.artifacts.workspacePath === 'string' |
| 1980 | ) { |
| 1981 | params.push({ label: 'Workspace', value: displayPath(result.artifacts.workspacePath) }); |
| 1982 | } |
| 1983 | if ( |
| 1984 | 'configuration' in result.artifacts && |
| 1985 | typeof result.artifacts.configuration === 'string' |
| 1986 | ) { |
| 1987 | params.push({ label: 'Configuration', value: result.artifacts.configuration }); |
| 1988 | } |
| 1989 | if ('platform' in result.artifacts && typeof result.artifacts.platform === 'string') { |
| 1990 | params.push({ label: 'Platform', value: result.artifacts.platform }); |
| 1991 | } |
| 1992 | } |
| 1993 | } |
| 1994 | |
| 1995 | const items: TextRenderableItem[] = [createHeader(title, params)]; |
| 1996 | if (result.didError) { |
| 1997 | items.push( |
| 1998 | ...createFailureStatusWithDiagnostics( |
| 1999 | result, |
| 2000 | isSwiftPackage ? 'Swift package clean failed.' : 'Clean failed.', |
| 2001 | ), |
| 2002 | ); |
| 2003 | return items; |
| 2004 | } |
| 2005 | |
| 2006 | items.push( |
| 2007 | createStatus( |
| 2008 | 'success', |
| 2009 | isSwiftPackage ? 'Swift package cleaned successfully' : 'Clean successful', |
| 2010 | ), |
| 2011 | ); |
| 2012 | return items; |
| 2013 | } |
| 2014 | |
| 2015 | function createDiagnosticSections(result: ToolDomainResult): SectionTextBlock[] { |
| 2016 | return createStandardDiagnosticSections(getResultDiagnostics(result)); |
no test coverage detected